diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index 307f860..40675be 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/misc.xml b/.idea/misc.xml
index e0d5b93..51fa3e5 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -5,7 +5,7 @@
diff --git a/app-dialog/build.gradle b/app-dialog/build.gradle
index b838768..69de2f5 100644
--- a/app-dialog/build.gradle
+++ b/app-dialog/build.gradle
@@ -11,7 +11,7 @@ android {
targetSdkVersion build_versions.targetSdk
versionCode app_version.versionCode
versionName app_version.versionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app-dialog/src/androidTest/java/com/king/app/dialog/ExampleInstrumentedTest.java b/app-dialog/src/androidTest/java/com/king/app/dialog/ExampleInstrumentedTest.java
index 53c32e3..8dfccf8 100644
--- a/app-dialog/src/androidTest/java/com/king/app/dialog/ExampleInstrumentedTest.java
+++ b/app-dialog/src/androidTest/java/com/king/app/dialog/ExampleInstrumentedTest.java
@@ -1,11 +1,10 @@
package com.king.app.dialog;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
-import org.junit.runner.RunWith;
+
+import androidx.test.InstrumentationRegistry;
import static org.junit.Assert.*;
@@ -14,7 +13,6 @@ import static org.junit.Assert.*;
*
* @see Testing documentation
*/
-@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
diff --git a/app-dialog/src/main/java/com/king/app/dialog/AppDialog.java b/app-dialog/src/main/java/com/king/app/dialog/AppDialog.java
index 5be3487..29efe2c 100644
--- a/app-dialog/src/main/java/com/king/app/dialog/AppDialog.java
+++ b/app-dialog/src/main/java/com/king/app/dialog/AppDialog.java
@@ -3,10 +3,6 @@ package com.king.app.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
-import android.support.annotation.NonNull;
-import android.support.annotation.StyleRes;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.FragmentManager;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
@@ -17,6 +13,11 @@ import android.widget.TextView;
import com.king.app.dialog.fragment.AppDialogFragment;
+import androidx.annotation.NonNull;
+import androidx.annotation.StyleRes;
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.FragmentManager;
+
/**
* @author Jenly Jenly
*/
@@ -38,7 +39,7 @@ public enum AppDialog {
* @param config 弹框配置 {@link AppDialogConfig}
* @return
*/
- public View createAppDialogView(@NonNull Context context,@NonNull AppDialogConfig config){
+ public View createAppDialogView(@NonNull Context context, @NonNull AppDialogConfig config){
View view = config.getView(context);
TextView tvDialogTitle = view.findViewById(config.getTitleId());
setText(tvDialogTitle,config.getTitle());
diff --git a/app-dialog/src/main/java/com/king/app/dialog/AppDialogConfig.java b/app-dialog/src/main/java/com/king/app/dialog/AppDialogConfig.java
index 70acaa4..5e7fdc2 100644
--- a/app-dialog/src/main/java/com/king/app/dialog/AppDialogConfig.java
+++ b/app-dialog/src/main/java/com/king/app/dialog/AppDialogConfig.java
@@ -1,12 +1,13 @@
package com.king.app.dialog;
import android.content.Context;
-import android.support.annotation.IdRes;
-import android.support.annotation.LayoutRes;
-import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.annotation.IdRes;
+import androidx.annotation.LayoutRes;
+import androidx.annotation.NonNull;
+
/**
* @author Jenly Jenly
*/
@@ -14,11 +15,13 @@ public class AppDialogConfig {
/**
* 布局ID
*/
- private @LayoutRes int layoutId = R.layout.app_dialog;
+ private @LayoutRes
+ int layoutId = R.layout.app_dialog;
/**
* 标题视图ID
*/
- private @IdRes int titleId = R.id.tvDialogTitle;
+ private @IdRes
+ int titleId = R.id.tvDialogTitle;
/**
* 内容视图ID
*/
diff --git a/app-dialog/src/main/java/com/king/app/dialog/fragment/BaseDialogFragment.java b/app-dialog/src/main/java/com/king/app/dialog/fragment/BaseDialogFragment.java
index 50863b6..7acd06b 100644
--- a/app-dialog/src/main/java/com/king/app/dialog/fragment/BaseDialogFragment.java
+++ b/app-dialog/src/main/java/com/king/app/dialog/fragment/BaseDialogFragment.java
@@ -5,9 +5,6 @@ import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.DialogFragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -18,6 +15,10 @@ import android.widget.TextView;
import com.king.app.dialog.R;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.DialogFragment;
+
/**
* @author Jenly Jenly
*/
diff --git a/app-updater/build.gradle b/app-updater/build.gradle
index 952d0f8..854a66c 100644
--- a/app-updater/build.gradle
+++ b/app-updater/build.gradle
@@ -11,7 +11,7 @@ android {
targetSdkVersion build_versions.targetSdk
versionCode app_version.versionCode
versionName app_version.versionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app-updater/src/androidTest/java/com/king/app/updater/ExampleInstrumentedTest.java b/app-updater/src/androidTest/java/com/king/app/updater/ExampleInstrumentedTest.java
index 10522ae..9cb1e7f 100644
--- a/app-updater/src/androidTest/java/com/king/app/updater/ExampleInstrumentedTest.java
+++ b/app-updater/src/androidTest/java/com/king/app/updater/ExampleInstrumentedTest.java
@@ -1,12 +1,13 @@
package com.king.app.updater;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import static org.junit.Assert.*;
/**
diff --git a/app-updater/src/main/java/com/king/app/updater/AppUpdater.java b/app-updater/src/main/java/com/king/app/updater/AppUpdater.java
index ed8430e..4019f7c 100644
--- a/app-updater/src/main/java/com/king/app/updater/AppUpdater.java
+++ b/app-updater/src/main/java/com/king/app/updater/AppUpdater.java
@@ -6,8 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
-import android.support.annotation.DrawableRes;
-import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
@@ -19,6 +17,9 @@ import com.king.app.updater.util.PermissionUtils;
import java.util.Map;
+import androidx.annotation.DrawableRes;
+import androidx.annotation.NonNull;
+
/**
* @author Jenly Jenly
@@ -43,7 +44,7 @@ public class AppUpdater {
private ServiceConnection mServiceConnection;
- public AppUpdater(@NonNull Context context,@NonNull UpdateConfig config){
+ public AppUpdater(@NonNull Context context, @NonNull UpdateConfig config){
this.mContext = context;
this.mConfig = config;
}
diff --git a/app-updater/src/main/java/com/king/app/updater/UpdateConfig.java b/app-updater/src/main/java/com/king/app/updater/UpdateConfig.java
index 30f55bb..74c9661 100644
--- a/app-updater/src/main/java/com/king/app/updater/UpdateConfig.java
+++ b/app-updater/src/main/java/com/king/app/updater/UpdateConfig.java
@@ -4,13 +4,14 @@ package com.king.app.updater;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
-import android.support.annotation.DrawableRes;
import com.king.app.updater.constant.Constants;
import java.util.HashMap;
import java.util.Map;
+import androidx.annotation.DrawableRes;
+
/**
* @author Jenly Jenly
diff --git a/app-updater/src/main/java/com/king/app/updater/http/HttpManager.java b/app-updater/src/main/java/com/king/app/updater/http/HttpManager.java
index 95a3b2a..e6323c0 100644
--- a/app-updater/src/main/java/com/king/app/updater/http/HttpManager.java
+++ b/app-updater/src/main/java/com/king/app/updater/http/HttpManager.java
@@ -2,7 +2,6 @@ package com.king.app.updater.http;
import android.os.AsyncTask;
import android.os.Build;
-import android.support.annotation.Nullable;
import android.util.Log;
import com.king.app.updater.constant.Constants;
@@ -18,6 +17,8 @@ import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
+import androidx.annotation.Nullable;
+
/**
* @author Jenly Jenly
*/
diff --git a/app-updater/src/main/java/com/king/app/updater/http/IHttpManager.java b/app-updater/src/main/java/com/king/app/updater/http/IHttpManager.java
index a927a5f..9b2cb7a 100644
--- a/app-updater/src/main/java/com/king/app/updater/http/IHttpManager.java
+++ b/app-updater/src/main/java/com/king/app/updater/http/IHttpManager.java
@@ -1,11 +1,12 @@
package com.king.app.updater.http;
-import android.support.annotation.Nullable;
import java.io.File;
import java.io.Serializable;
import java.util.Map;
+import androidx.annotation.Nullable;
+
/**
* @author Jenly Jenly
*/
diff --git a/app-updater/src/main/java/com/king/app/updater/provider/AppUpdaterFileProvider.java b/app-updater/src/main/java/com/king/app/updater/provider/AppUpdaterFileProvider.java
index 5be2607..e300bf2 100644
--- a/app-updater/src/main/java/com/king/app/updater/provider/AppUpdaterFileProvider.java
+++ b/app-updater/src/main/java/com/king/app/updater/provider/AppUpdaterFileProvider.java
@@ -1,6 +1,7 @@
package com.king.app.updater.provider;
-import android.support.v4.content.FileProvider;
+
+import androidx.core.content.FileProvider;
/**
* @author Jenly Jenly
diff --git a/app-updater/src/main/java/com/king/app/updater/service/DownloadService.java b/app-updater/src/main/java/com/king/app/updater/service/DownloadService.java
index dce850c..c61483f 100644
--- a/app-updater/src/main/java/com/king/app/updater/service/DownloadService.java
+++ b/app-updater/src/main/java/com/king/app/updater/service/DownloadService.java
@@ -12,11 +12,6 @@ import android.os.Binder;
import android.os.Build;
import android.os.Environment;
import android.os.IBinder;
-import android.support.annotation.DrawableRes;
-import android.support.annotation.Nullable;
-import android.support.annotation.RequiresApi;
-import android.support.v4.app.NotificationCompat;
-import android.support.v4.content.FileProvider;
import android.text.TextUtils;
import android.util.Log;
@@ -30,6 +25,12 @@ import com.king.app.updater.util.AppUtils;
import java.io.File;
+import androidx.annotation.DrawableRes;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.core.app.NotificationCompat;
+import androidx.core.content.FileProvider;
+
/**
* @author Jenly Jenly
@@ -347,7 +348,7 @@ public class DownloadService extends Service {
* @param title
* @param content
*/
- private void showStartNotification(int notifyId,String channelId, String channelName,@DrawableRes int icon,CharSequence title,CharSequence content,boolean isVibrate,boolean isSound){
+ private void showStartNotification(int notifyId, String channelId, String channelName, @DrawableRes int icon, CharSequence title, CharSequence content, boolean isVibrate, boolean isSound){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
createNotificationChannel(channelId,channelName,isVibrate,isSound);
}
diff --git a/app-updater/src/main/java/com/king/app/updater/util/AppUtils.java b/app-updater/src/main/java/com/king/app/updater/util/AppUtils.java
index bff377b..d5c92a0 100644
--- a/app-updater/src/main/java/com/king/app/updater/util/AppUtils.java
+++ b/app-updater/src/main/java/com/king/app/updater/util/AppUtils.java
@@ -7,10 +7,12 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
-import android.support.v4.content.FileProvider;
import android.text.TextUtils;
import java.io.File;
+import java.lang.Exception;
+
+import androidx.core.content.FileProvider;
/**
* @author Jenly Jenly
diff --git a/app-updater/src/main/java/com/king/app/updater/util/PermissionUtils.java b/app-updater/src/main/java/com/king/app/updater/util/PermissionUtils.java
index f6cd5b8..557b672 100644
--- a/app-updater/src/main/java/com/king/app/updater/util/PermissionUtils.java
+++ b/app-updater/src/main/java/com/king/app/updater/util/PermissionUtils.java
@@ -9,12 +9,13 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.v4.app.ActivityCompat;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import androidx.annotation.NonNull;
+import androidx.core.app.ActivityCompat;
+
/**
* @author Jenly Jenly
*/
@@ -33,7 +34,7 @@ public enum PermissionUtils {
* @param requestCode
* @return
*/
- public boolean verifyReadAndWritePermissions(@NonNull Activity activity,int requestCode){
+ public boolean verifyReadAndWritePermissions(@NonNull Activity activity, int requestCode){
int readResult = checkPermission(activity,Manifest.permission.READ_EXTERNAL_STORAGE);
int writeResult = checkPermission(activity,Manifest.permission.WRITE_EXTERNAL_STORAGE);
diff --git a/app-updater/src/main/java/com/king/app/updater/util/SSLSocketFactoryUtils.java b/app-updater/src/main/java/com/king/app/updater/util/SSLSocketFactoryUtils.java
index 5706cea..31c9811 100644
--- a/app-updater/src/main/java/com/king/app/updater/util/SSLSocketFactoryUtils.java
+++ b/app-updater/src/main/java/com/king/app/updater/util/SSLSocketFactoryUtils.java
@@ -1,7 +1,6 @@
package com.king.app.updater.util;
import android.content.Context;
-import android.support.annotation.RawRes;
import java.io.InputStream;
import java.security.KeyManagementException;
@@ -21,6 +20,8 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
+import androidx.annotation.RawRes;
+
/**
* @author Jenly Jenly
*/
diff --git a/app/build.gradle b/app/build.gradle
index 414c9d9..021c83b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -10,7 +10,7 @@ android {
targetSdkVersion build_versions.targetSdk
versionCode app_version.versionCode
versionName app_version.versionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
index ce321b3..c039881 100644
Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ
diff --git a/app/release/output.json b/app/release/output.json
index bf5ffe2..f36d4d7 100644
--- a/app/release/output.json
+++ b/app/release/output.json
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"1.0.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":6,"versionName":"1.0.4-androidx","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/king/appupdater/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/king/appupdater/ExampleInstrumentedTest.java
index 4b16d89..f118a95 100644
--- a/app/src/androidTest/java/com/king/appupdater/ExampleInstrumentedTest.java
+++ b/app/src/androidTest/java/com/king/appupdater/ExampleInstrumentedTest.java
@@ -1,12 +1,13 @@
package com.king.appupdater;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
import static org.junit.Assert.*;
/**
diff --git a/app/src/main/java/com/king/appupdater/MainActivity.java b/app/src/main/java/com/king/appupdater/MainActivity.java
index e572638..7b7f74d 100644
--- a/app/src/main/java/com/king/appupdater/MainActivity.java
+++ b/app/src/main/java/com/king/appupdater/MainActivity.java
@@ -4,8 +4,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Environment;
-import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
@@ -24,6 +22,9 @@ import com.king.app.updater.util.PermissionUtils;
import java.io.File;
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+
public class MainActivity extends AppCompatActivity {
private final Object mLock = new Object();
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 5172e82..afc5180 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/versions.gradle b/versions.gradle
index f3bf6aa..3316de5 100644
--- a/versions.gradle
+++ b/versions.gradle
@@ -1,7 +1,7 @@
//App
def app_version = [:]
-app_version.versionCode = 5 //androidx 6
-app_version.versionName = "1.0.4"
+app_version.versionCode = 6 //androidx 6
+app_version.versionName = "1.0.4-androidx"
ext.app_version = app_version
//build version
@@ -15,28 +15,30 @@ ext.build_versions = build_versions
// App dependencies
def versions = [:]
//support
-versions.supportLibrary = "28.0.0"
+versions.supportLibrary = "1.0.0+"
versions.constraintLayout = "1.1.3"
//test
-versions.junit = "4.12"
-versions.runner = "1.0.2"
-versions.espresso = "3.0.2"
+versions.junit = "1.1.0"
+versions.test = "1.2.0"
+versions.runner = "1.2.0"
+versions.espresso = "3.2.0"
ext.versions = versions
ext.deps = [:]
//support
def support = [:]
-support.appcompat = "com.android.support:appcompat-v7:$versions.supportLibrary"
-support.constraintlayout = "com.android.support.constraint:constraint-layout:$versions.constraintLayout"
+support.appcompat = "androidx.appcompat:appcompat:$versions.supportLibrary"
+support.constraintlayout = "androidx.constraintlayout:constraintlayout:$versions.constraintLayout"
deps.support = support
//test
def test = [:]
-test.junit = "junit:junit:$versions.junit"
-test.runner = "com.android.support.test:runner:$versions.runner"
-test.espresso = "com.android.support.test.espresso:espresso-core:$versions.espresso"
+test.junit = "androidx.test.ext:junit:$versions.junit"
+test.test = "androidx.test:core:$versions.test"
+test.runner = "androidx.test:runner:$versions.runner"
+test.espresso = "androidx.test.espresso:espresso-core:$versions.espresso"
deps.test = test