Skip to content

Commit 75e46de

Browse files
committed
migrate project to android x
1 parent df97d38 commit 75e46de

File tree

12 files changed

+31
-31
lines changed

12 files changed

+31
-31
lines changed

app/build.gradle

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

33
android {
4-
compileSdkVersion 27
4+
compileSdkVersion 29
55
defaultConfig {
66
applicationId "com.application.isradeleon.notifyexample"
77
minSdkVersion 19
8-
targetSdkVersion 27
8+
targetSdkVersion 29
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:27.1.1'
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

2929
implementation project(':notify')
3030
}

app/src/androidTest/java/com/application/isradeleon/notifyexample/ExampleInstrumentedTest.java

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.application.isradeleon.notifyexample;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import androidx.appcompat.app.AppCompatActivity;
44
import android.os.Bundle;
55

66
import com.application.isradeleon.notify.Notify;

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"
@@ -15,4 +15,4 @@
1515
app:layout_constraintRight_toRightOf="parent"
1616
app:layout_constraintTop_toTopOf="parent" />
1717

18-
</android.support.constraint.ConstraintLayout>
18+
</androidx.constraintlayout.widget.ConstraintLayout>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.4.2'
10+
classpath 'com.android.tools.build:gradle:4.0.2'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

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-
#Sat Jun 29 10:48:48 CDT 2019
1+
#Tue Dec 15 15:11:44 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-5.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

notify/build.gradle

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

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

66
defaultConfig {
77
minSdkVersion 19
8-
targetSdkVersion 27
8+
targetSdkVersion 29
99
versionCode 1
1010
versionName "1.0"
1111

12-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1313

1414
}
1515

@@ -26,9 +26,9 @@ dependencies {
2626
implementation fileTree(dir: 'libs', include: ['*.jar'])
2727

2828
def compatVersion = '27.1.1';
29-
implementation "com.android.support:appcompat-v7:$compatVersion"
29+
implementation 'androidx.appcompat:appcompat:1.0.0'
3030

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
}

notify/src/androidTest/java/com/application/isradeleon/notify/ExampleInstrumentedTest.java

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

notify/src/main/java/com/application/isradeleon/notify/Notify.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import android.graphics.Bitmap;
1212
import android.graphics.Color;
1313
import android.os.Build;
14-
import android.support.annotation.ColorRes;
15-
import android.support.annotation.DrawableRes;
16-
import android.support.annotation.NonNull;
17-
import android.support.v4.app.NotificationCompat;
14+
import androidx.annotation.ColorRes;
15+
import androidx.annotation.DrawableRes;
16+
import androidx.annotation.NonNull;
17+
import androidx.core.app.NotificationCompat;
1818

1919
import com.application.isradeleon.notify.exceptions.NotifyDefaultChannelInfoNotFoundException;
2020
import com.application.isradeleon.notify.helpers.BitmapHelper;
@@ -56,11 +56,9 @@ private Notify(Context _context){
5656
this.id = (int) System.currentTimeMillis();
5757

5858
try{
59-
6059
this.channelId = getStringResourceByKey(context, DefaultChannelKeys.ID);
6160
this.channelName = getStringResourceByKey(context, DefaultChannelKeys.NAME);
6261
this.channelDescription = getStringResourceByKey(context, DefaultChannelKeys.DESCRIPTION);
63-
6462
} catch (Resources.NotFoundException e){ throw new NotifyDefaultChannelInfoNotFoundException(); }
6563

6664
this.title = "Notify";

0 commit comments

Comments
 (0)