Skip to content

Commit d7d029e

Browse files
author
teach
committed
迁移androidx
1 parent b8bf2a8 commit d7d029e

File tree

13 files changed

+41
-41
lines changed

13 files changed

+41
-41
lines changed

app/build.gradle

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

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.3"
4+
compileSdkVersion 30
5+
buildToolsVersion "29.0.3"
66
defaultConfig {
77
applicationId "com.donkingliang.headerviewadapterdemo"
88
minSdkVersion 14
9-
targetSdkVersion 25
9+
targetSdkVersion 30
1010
versionCode 1
1111
versionName "1.0"
12-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1313
}
1414
buildTypes {
1515
release {
@@ -20,13 +20,13 @@ android {
2020
}
2121

2222
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
23+
implementation fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
2525
exclude group: 'com.android.support', module: 'support-annotations'
2626
})
27-
compile 'com.android.support:appcompat-v7:25.3.1'
28-
compile 'com.android.support.constraint:constraint-layout:1.0.2'
29-
testCompile 'junit:junit:4.12'
30-
31-
compile project(":headerviewadapter")
27+
implementation 'androidx.appcompat:appcompat:1.2.0'
28+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
29+
testImplementation 'junit:junit:4.12'
30+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
31+
implementation project(":headerviewadapter")
3232
}

app/src/androidTest/java/com/donkingliang/headerviewadapterdemo/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.donkingliang.headerviewadapterdemo;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
import androidx.test.platform.app.InstrumentationRegistry;
5+
import androidx.test.ext.junit.runners.AndroidJUnit4;
66

77
import org.junit.Test;
88
import org.junit.runner.RunWith;

app/src/main/java/com/donkingliang/headerviewadapterdemo/MainActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.donkingliang.headerviewadapterdemo;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import androidx.appcompat.app.AppCompatActivity;
44
import android.os.Bundle;
5-
import android.support.v7.widget.GridLayoutManager;
6-
import android.support.v7.widget.LinearLayoutManager;
7-
import android.support.v7.widget.RecyclerView;
5+
import androidx.recyclerview.widget.GridLayoutManager;
6+
import androidx.recyclerview.widget.LinearLayoutManager;
7+
88
import android.view.LayoutInflater;
99
import android.view.View;
1010

app/src/main/java/com/donkingliang/headerviewadapterdemo/adapter/GridAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.donkingliang.headerviewadapterdemo.adapter;
22

33
import android.content.Context;
4-
import android.support.v7.widget.RecyclerView;
4+
import androidx.recyclerview.widget.RecyclerView;
55
import android.util.Log;
66
import android.view.LayoutInflater;
77
import android.view.View;

app/src/main/java/com/donkingliang/headerviewadapterdemo/adapter/LinearAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.donkingliang.headerviewadapterdemo.adapter;
22

33
import android.content.Context;
4-
import android.support.v7.widget.RecyclerView;
4+
import androidx.recyclerview.widget.RecyclerView;
55
import android.util.Log;
66
import android.view.LayoutInflater;
77
import android.view.View;

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
buildscript {
44
repositories {
5+
google()
56
jcenter()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.2'
9+
classpath 'com.android.tools.build:gradle:3.4.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -14,6 +15,7 @@ buildscript {
1415

1516
allprojects {
1617
repositories {
18+
google()
1719
jcenter()
1820
}
1921
}

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.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Nov 10 09:14:28 CST 2017
1+
#Fri Mar 13 16:42:52 CST 2020
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-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

headerviewadapter/build.gradle

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ apply plugin: 'com.android.library'
22
group='com.github.donkingliang' // 指定group,com.github.<用户名>
33

44
android {
5-
compileSdkVersion 25
6-
buildToolsVersion "25.0.3"
5+
compileSdkVersion 30
6+
buildToolsVersion "29.0.3"
77

88
defaultConfig {
99
minSdkVersion 14
10-
targetSdkVersion 25
10+
targetSdkVersion 30
1111
versionCode 1
1212
versionName "1.0"
1313

14-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1515

1616
}
1717
buildTypes {
@@ -23,13 +23,9 @@ android {
2323
}
2424

2525
dependencies {
26-
compile fileTree(dir: 'libs', include: ['*.jar'])
27-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28-
exclude group: 'com.android.support', module: 'support-annotations'
29-
})
30-
compile 'com.android.support:appcompat-v7:25.3.1'
31-
testCompile 'junit:junit:4.12'
32-
compile 'com.android.support:recyclerview-v7:25.3.1'
26+
implementation fileTree(dir: 'libs', include: ['*.jar'])
27+
compileOnly 'androidx.appcompat:appcompat:1.2.0'
28+
compileOnly 'androidx.recyclerview:recyclerview:1.1.0'
3329
}
3430

3531
//---------------------------------------------

headerviewadapter/src/androidTest/java/com/donkingliang/headerviewadapter/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.donkingliang.headerviewadapter;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
import androidx.test.platform.app.InstrumentationRegistry;
5+
import androidx.test.ext.junit.runners.AndroidJUnit4;
66

77
import org.junit.Test;
88
import org.junit.runner.RunWith;

0 commit comments

Comments
 (0)