Skip to content

Commit a10ff7c

Browse files
authored
Migrate to AndroidX
2 parents 67708fc + b09840d commit a10ff7c

26 files changed

Lines changed: 110 additions & 101 deletions

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.41'
2+
ext.kotlin_version = '1.2.71'
33
repositories {
44
google()
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.1.3'
8+
classpath 'com.android.tools.build:gradle:3.2.1'
99
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1010
}
1111
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9+
android.enableJetifier=true
10+
android.useAndroidX=true
911
org.gradle.jvmargs=-Xmx1536m
1012
# When configured, Gradle will run in incubating parallel mode.
1113
# This option should only be used with decoupled projects. More details, visit
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Mar 20 20:09:11 PDT 2018
1+
#Wed Nov 21 04:18:10 CST 2018
22
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-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

indicator-fast-scroll/build.gradle

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ apply plugin: 'kotlin-android'
44
def libraryVersionName = '1.0.1'
55

66
android {
7-
compileSdkVersion 27
7+
compileSdkVersion 28
88

99
defaultConfig {
1010
minSdkVersion 21
11-
targetSdkVersion 27
11+
targetSdkVersion 28
1212
versionCode 1
1313
versionName libraryVersionName
14-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1515
}
1616

1717
// TODO replace with https://issuetracker.google.com/issues/72050365 once released.
@@ -23,16 +23,15 @@ android {
2323
dependencies {
2424
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2525

26-
def supportLibVersion = "27.1.1"
27-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
28-
implementation "com.android.support:recyclerview-v7:$supportLibVersion"
29-
implementation "com.android.support:support-dynamic-animation:$supportLibVersion"
30-
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
26+
implementation 'androidx.appcompat:appcompat:1.0.2'
27+
implementation 'androidx.recyclerview:recyclerview:1.0.0'
28+
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
29+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
3130

32-
implementation 'androidx.core:core-ktx:0.3'
31+
implementation 'androidx.core:core-ktx:1.0.1'
3332

3433
testImplementation 'junit:junit:4.12'
35-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
36-
androidTestImplementation 'com.android.support.test:rules:1.0.2'
37-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
34+
androidTestImplementation "androidx.test.ext:junit:1.0.0"
35+
androidTestImplementation 'androidx.test:rules:1.1.0'
36+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
3837
}

indicator-fast-scroll/src/androidTest/java/com/reddit/indicatorfastscroll/TestActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package com.reddit.indicatorfastscroll
22

33
import android.content.Context
44
import android.os.Bundle
5-
import android.support.v7.app.AppCompatActivity
6-
import android.support.v7.widget.AppCompatTextView
7-
import android.support.v7.widget.LinearLayoutManager
8-
import android.support.v7.widget.RecyclerView
95
import android.view.ViewGroup
106
import android.widget.TextView
7+
import androidx.appcompat.app.AppCompatActivity
8+
import androidx.appcompat.widget.AppCompatTextView
9+
import androidx.recyclerview.widget.LinearLayoutManager
10+
import androidx.recyclerview.widget.RecyclerView
1111
import com.reddit.indicatorfastscroll.test.R
1212

1313
class TestActivity : AppCompatActivity() {

indicator-fast-scroll/src/androidTest/java/com/reddit/indicatorfastscroll/TestItemIndicatorsBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.reddit.indicatorfastscroll
22

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

55
internal class TestItemIndicatorsBuilder : ItemIndicatorsBuilder() {
66

indicator-fast-scroll/src/androidTest/java/com/reddit/indicatorfastscroll/Tests.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.reddit.indicatorfastscroll
22

3-
import android.support.test.espresso.Espresso.onView
4-
import android.support.test.espresso.action.ViewActions
5-
import android.support.test.espresso.assertion.ViewAssertions.matches
6-
import android.support.test.espresso.matcher.ViewMatchers.*
7-
import android.support.test.filters.LargeTest
8-
import android.support.test.rule.ActivityTestRule
9-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.espresso.Espresso.onView
4+
import androidx.test.espresso.action.ViewActions
5+
import androidx.test.espresso.assertion.ViewAssertions.matches
6+
import androidx.test.espresso.matcher.ViewMatchers.*
7+
import androidx.test.ext.junit.runners.AndroidJUnit4
8+
import androidx.test.filters.LargeTest
9+
import androidx.test.rule.ActivityTestRule
1010
import com.reddit.indicatorfastscroll.test.R
1111
import org.hamcrest.Matchers.*
1212
import org.junit.Assert.assertEquals

indicator-fast-scroll/src/androidTest/res/layout/test.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:layout_height="match_parent"
55
>
66

7-
<android.support.v7.widget.RecyclerView
7+
<androidx.recyclerview.widget.RecyclerView
88
android:id="@+id/test_recyclerview"
99
android:layout_width="match_parent"
1010
android:layout_height="match_parent"

indicator-fast-scroll/src/main/java/com/reddit/indicatorfastscroll/FastScrollItemIndicator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.reddit.indicatorfastscroll
22

3-
import android.support.annotation.DrawableRes
3+
import androidx.annotation.DrawableRes
44

55
sealed class FastScrollItemIndicator {
66
data class Icon(@DrawableRes val iconRes: Int) : FastScrollItemIndicator()

indicator-fast-scroll/src/main/java/com/reddit/indicatorfastscroll/FastScrollerThumbView.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ import android.content.Context
55
import android.content.res.ColorStateList
66
import android.graphics.drawable.GradientDrawable
77
import android.os.Build
8-
import android.support.animation.DynamicAnimation
9-
import android.support.animation.SpringAnimation
10-
import android.support.animation.SpringForce
11-
import android.support.constraint.ConstraintLayout
12-
import android.support.v4.widget.TextViewCompat
138
import android.util.AttributeSet
149
import android.view.LayoutInflater
1510
import android.view.ViewGroup
1611
import android.widget.ImageView
1712
import android.widget.TextView
13+
import androidx.constraintlayout.widget.ConstraintLayout
1814
import androidx.core.content.res.getColorOrThrow
1915
import androidx.core.content.res.getColorStateListOrThrow
2016
import androidx.core.content.res.getResourceIdOrThrow
2117
import androidx.core.content.res.use
2218
import androidx.core.view.doOnPreDraw
2319
import androidx.core.view.isVisible
20+
import androidx.core.widget.TextViewCompat
21+
import androidx.dynamicanimation.animation.DynamicAnimation
22+
import androidx.dynamicanimation.animation.SpringAnimation
23+
import androidx.dynamicanimation.animation.SpringForce
2424

2525
/**
2626
* Companion view for a [fast scroller][FastScrollerView] that shows its currently pressed indicator

0 commit comments

Comments
 (0)