Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compatibility with api 28 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions LoopBar-widget/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ apply plugin: 'com.android.library'


android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 28

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 10
versionName "1.1.4"
}
Expand All @@ -34,15 +33,15 @@ android {
dependencies {
final SUPPORT_LIB_VERSION = '25.1.1'

compile fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
compile "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
//noinspection GradleCompatible
compile "com.android.support:recyclerview-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:recyclerview-v7:$SUPPORT_LIB_VERSION"
//noinspection GradleCompatible
compile "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
//noinspection GradleCompatible
compile "com.android.support:cardview-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:cardview-v7:$SUPPORT_LIB_VERSION"
}

apply from: './gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
Expand Down Expand Up @@ -413,7 +414,7 @@ public void setCategoriesAdapter(@NonNull RecyclerView.Adapter<? extends Recycle
* @param menuRes id for inflating {@link Menu}
*/
public void setCategoriesAdapterFromMenu(@MenuRes int menuRes) {
Menu menu = new MenuBuilder(getContext());
@SuppressLint("RestrictedApi") Menu menu = new MenuBuilder(getContext());
new MenuInflater(getContext()).inflate(menuRes, menu);
setCategoriesAdapterFromMenu(menu);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NegativeMarginFixColorDrawable extends android.graphics.drawable.ColorDraw

@Override
public void draw(Canvas canvas) {
canvas.clipRect(getBounds(), Region.Op.REPLACE);
// canvas.clipRect(getBounds(), Region.Op.REPLACE);
super.draw(canvas);
}
}
1 change: 1 addition & 0 deletions LoopBar-widget/src/main/res/layout/enls_dock.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:clipChildren="false"
android:layout_height="match_parent"
android:orientation="vertical">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:clipChildren="false"
android:layout_width="@dimen/enls_selected_view_width"
android:layout_height="match_parent"
android:background="@android:color/transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:clipChildren="false"
android:layout_height="@dimen/enls_selected_view_height"
android:background="@android:color/transparent"
tools:background="@color/enls_default_selection_view_background" />
1 change: 1 addition & 0 deletions LoopBar-widget/src/main/res/layout/enls_empty_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:clipChildren="false"
android:layout_height="0dp"
xmlns:tools="http://schemas.android.com/tools"
tools:background="@color/enls_default_selection_view_background">
Expand Down
1 change: 1 addition & 0 deletions LoopBar-widget/src/main/res/layout/enls_item_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:clipChildren="false"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:clipChildren="false"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:clipToPadding="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:clipChildren="false"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:clipToPadding="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:clipChildren="false"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:clipChildren="false"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@android:color/transparent"
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.5.0-alpha09'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Sun Apr 14 07:11:24 CAT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-rc-2-all.zip
14 changes: 8 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
applicationId "com.cleveroad.loopbar.sample"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 10
versionName "1.1.4"
}
Expand All @@ -22,8 +22,10 @@ android {
dependencies {
final SUPPORT_LIB_VERSION = '25.3.1'

compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':LoopBar-widget')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':LoopBar-widget')
//noinspection GradleCompatible
compile "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.android.support:recyclerview-v7:28.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

if (savedInstanceState == null) {
replaceFragment(CategoriesAdapterLoopBarFragment.newInstance(Orientation.ORIENTATION_VERTICAL_LEFT));
replaceFragment(CategoriesAdapterLoopBarFragment.newInstance(Orientation.ORIENTATION_HORIZONTAL_BOTTOM));
}
}

Expand Down