Skip to content

Commit bb1e183

Browse files
committed
Migrate to Android X
1 parent 0c2450d commit bb1e183

File tree

10 files changed

+31
-37
lines changed

10 files changed

+31
-37
lines changed

build.gradle

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
repositories {
3+
google()
54
jcenter()
65
}
76
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.3'
9-
10-
// NOTE: Do not place your application dependencies here; they belong
11-
// in the individual module build.gradle files
7+
classpath 'com.android.tools.build:gradle:3.2.1'
128
}
139
}
1410

15-
ext {
16-
supportLibraryVersion = '26.1.0'
17-
}
18-
1911
allprojects {
2012
repositories {
13+
google()
2114
jcenter()
22-
maven { url "https://maven.google.com" }
2315
}
2416
}
2517

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12+
android.enableJetifier=true
13+
android.useAndroidX=true
1214
org.gradle.jvmargs=-Xmx1536m
1315

1416
# When configured, Gradle will run in incubating parallel mode.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

library/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ ext {
99
}
1010

1111
android {
12-
compileSdkVersion 26
13-
buildToolsVersion "26.0.1"
12+
compileSdkVersion 28
1413

1514
defaultConfig {
1615
minSdkVersion 16
17-
targetSdkVersion 26
16+
targetSdkVersion 28
1817
versionCode 1
1918
versionName "1.0"
2019
}
@@ -27,12 +26,12 @@ android {
2726
}
2827

2928
dependencies {
30-
compile fileTree(dir: 'libs', include: ['*.jar'])
29+
implementation fileTree(dir: 'libs', include: ['*.jar'])
3130

32-
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
33-
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
31+
implementation "androidx.appcompat:appcompat:1.0.0"
32+
implementation "androidx.recyclerview:recyclerview:1.0.0"
3433

35-
compile "com.andkulikov:transitionseverywhere:1.7.6"
34+
implementation "com.andkulikov:transitionseverywhere:1.8.0"
3635
}
3736

3837
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'

library/src/main/java/cz/intik/overflowindicator/OverflowDataObserver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cz.intik.overflowindicator;
22

3-
import android.support.v7.widget.RecyclerView;
3+
import androidx.recyclerview.widget.RecyclerView;
44

55
/**
66
* Data observer which notifies {@link OverflowPagerIndicator} of changed data

library/src/main/java/cz/intik/overflowindicator/OverflowPagerIndicator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cz.intik.overflowindicator;
22

33
import android.content.Context;
4-
import android.support.annotation.Nullable;
5-
import android.support.v7.widget.PagerSnapHelper;
6-
import android.support.v7.widget.RecyclerView;
4+
import androidx.annotation.Nullable;
5+
import androidx.recyclerview.widget.PagerSnapHelper;
6+
import androidx.recyclerview.widget.RecyclerView;
77
import android.util.AttributeSet;
88
import android.util.DisplayMetrics;
99
import android.util.TypedValue;

library/src/main/java/cz/intik/overflowindicator/SimpleSnapHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package cz.intik.overflowindicator;
22

3-
import android.support.annotation.NonNull;
4-
import android.support.v7.widget.PagerSnapHelper;
5-
import android.support.v7.widget.RecyclerView;
3+
import androidx.annotation.NonNull;
4+
import androidx.recyclerview.widget.PagerSnapHelper;
5+
import androidx.recyclerview.widget.RecyclerView;
66

77
/**
88
* SnapHelper which allows snapping of pages, customized with notifying of {@link OverflowPagerIndicator}

sample-app/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 26
5-
buildToolsVersion "26.0.1"
4+
compileSdkVersion 28
5+
66
defaultConfig {
77
applicationId "cz.intik.overflowpagerindicator"
88
minSdkVersion 21
9-
targetSdkVersion 26
9+
targetSdkVersion 28
1010
versionCode 1
1111
versionName "1.0"
1212
}
13+
1314
buildTypes {
1415
release {
1516
minifyEnabled false
@@ -19,8 +20,8 @@ android {
1920
}
2021

2122
dependencies {
22-
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
23-
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
23+
implementation "androidx.appcompat:appcompat:1.0.0"
24+
implementation "androidx.recyclerview:recyclerview:1.0.0"
2425

25-
compile project(path: ':library')
26+
implementation project(path: ':library')
2627
}

sample-app/src/main/java/cz/intik/overflowpagerindicator/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import android.graphics.Color;
44
import android.os.Bundle;
5-
import android.support.v7.app.AppCompatActivity;
6-
import android.support.v7.widget.LinearLayoutManager;
7-
import android.support.v7.widget.RecyclerView;
5+
import androidx.appcompat.app.AppCompatActivity;
6+
import androidx.recyclerview.widget.LinearLayoutManager;
7+
import androidx.recyclerview.widget.RecyclerView;
88
import android.view.ViewGroup;
99
import android.widget.FrameLayout;
1010

sample-app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
android:layout_height="wrap_content"
1414
android:layout_marginTop="64dp">
1515

16-
<android.support.v7.widget.RecyclerView
16+
<androidx.recyclerview.widget.RecyclerView
1717
android:id="@+id/recycler_view"
1818
android:layout_width="match_parent"
1919
android:layout_height="120dp"
@@ -33,7 +33,7 @@
3333
android:layout_height="wrap_content"
3434
android:layout_marginTop="64dp">
3535

36-
<android.support.v7.widget.RecyclerView
36+
<androidx.recyclerview.widget.RecyclerView
3737
android:id="@+id/recycler_view_simple"
3838
android:layout_width="match_parent"
3939
android:layout_height="120dp"

0 commit comments

Comments
 (0)