Skip to content

Commit c1d4478

Browse files
committed
[1.1.0][new feature][v4,v7包换成AndroidX]
1 parent f90c687 commit c1d4478

10 files changed

Lines changed: 102 additions & 23 deletions

File tree

app/.gitignore

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
/build
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
.idea/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Sign files
21+
buildsystem/release.jks
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
signing.properties
25+
26+
# Proguard folder generated by Eclipse
27+
proguard/
28+
29+
# Log Files
30+
*.log
31+
*.iml
32+
33+
# Android Studio Navigation editor temp files
34+
.navigation/
35+
36+
# Android Studio captures folder
37+
captures/
38+
ck-app-debug/
39+
src/debug/

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
targetSdkVersion 28
99
versionCode 1
1010
versionName "1.0"
11-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
11+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {
1414
release {
@@ -20,11 +20,11 @@ android {
2020

2121
dependencies {
2222
implementation fileTree(dir: 'libs', include: ['*.jar'])
23-
implementation 'com.android.support:appcompat-v7:28.0.0'
24-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
23+
implementation 'androidx.appcompat:appcompat:1.0.0'
24+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
2525
testImplementation 'junit:junit:4.12'
26-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
27-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
26+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
27+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
2828
implementation project(':drawablewithshadow')
2929

3030
}

app/src/androidTest/java/com/cuibg/shadowdrawable/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.cuibg.shadowdrawable;
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/cuibg/shadowdrawable/MainActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import android.graphics.BitmapFactory;
44
import android.graphics.Color;
55
import android.os.Bundle;
6-
import android.support.v4.view.ViewCompat;
7-
import android.support.v7.app.AppCompatActivity;
86
import android.view.View;
97

108
import com.cuibg.drawablewithshadow.DrawableWithShadow;
119
import com.cuibg.drawablewithshadow.LinearGradientConfig;
1210

11+
import androidx.appcompat.app.AppCompatActivity;
12+
import androidx.core.view.ViewCompat;
13+
1314
public class MainActivity extends AppCompatActivity {
1415

1516
private static final int DRAWABLE_BG_COLOR = Color.parseColor("#90EE90");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
@@ -30,4 +30,4 @@
3030
android:layout_marginTop="20dp"
3131
app:layout_constraintStart_toStartOf="parent"
3232
app:layout_constraintTop_toBottomOf="@+id/view_two"/>
33-
</android.support.constraint.ConstraintLayout>
33+
</androidx.constraintlayout.widget.ConstraintLayout>

drawablewithshadow/.gitignore

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
/build
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
.idea/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Sign files
21+
buildsystem/release.jks
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
signing.properties
25+
26+
# Proguard folder generated by Eclipse
27+
proguard/
28+
29+
# Log Files
30+
*.log
31+
*.iml
32+
33+
# Android Studio Navigation editor temp files
34+
.navigation/
35+
36+
# Android Studio captures folder
37+
captures/
38+
ck-app-debug/
39+
src/debug/

drawablewithshadow/build.gradle

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

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 29
55

66

77

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

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

1616
}
1717

@@ -27,8 +27,8 @@ android {
2727
dependencies {
2828
implementation fileTree(dir: 'libs', include: ['*.jar'])
2929

30-
implementation 'com.android.support:appcompat-v7:28.0.0'
30+
implementation 'androidx.appcompat:appcompat:1.0.0'
3131
testImplementation 'junit:junit:4.12'
32-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
33-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
32+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
33+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
3434
}

drawablewithshadow/src/androidTest/java/com/cuibg/drawablewithshadow/ExampleInstrumentedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.cuibg.drawablewithshadow;
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;

drawablewithshadow/src/main/java/com/cuibg/drawablewithshadow/DrawableWithShadow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import android.graphics.RectF;
1111
import android.graphics.Shader;
1212
import android.graphics.drawable.Drawable;
13-
import android.support.annotation.NonNull;
14-
import android.support.annotation.Nullable;
13+
import androidx.annotation.NonNull;
14+
import androidx.annotation.Nullable;
1515

1616
/**
1717
* @author cuibg

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

0 commit comments

Comments
 (0)