diff --git a/config/repository.gradle b/config/repository.gradle deleted file mode 100644 index 1380093..0000000 --- a/config/repository.gradle +++ /dev/null @@ -1,349 +0,0 @@ -class Repository { - Map androidLibraries - Map kotlinLibraries - Map thirdLibraries - Map uiLibraries - Map debugLibraries - Map testLibraries -} - -ext { - newRepository = this.&innerNewRepository -} - -static Repository innerNewRepository() { - - def androidLibrariesVersion = "28.0.0" - def android_plugin_version = '3.1.4' - - def androidLibraries = [ - //https://developer.android.com/topic/libraries/support-library/features.html - androidCompatV4 : "com.android.support:support-v4:${androidLibrariesVersion}",//v4 all - androidCompatV7 : "com.android.support:appcompat-v7:${androidLibrariesVersion}", - androidCompatV13 : "com.android.support:support-v13:${androidLibrariesVersion}", - androidDesign : "com.android.support:design:${androidLibrariesVersion}", - androidPrecent : "com.android.support:percent:${androidLibrariesVersion}", - androidAnnotations : "com.android.support:support-annotations:${androidLibrariesVersion}", - androidCard : "com.android.support:cardview-v7:${androidLibrariesVersion}", - androidRecyclerView : "com.android.support:recyclerview-v7:${androidLibrariesVersion}", - transition : "com.android.support:transition:${androidLibrariesVersion}", - androidExif : "com.android.support:exifinterface:${androidLibrariesVersion}", - gridlayout : "com.android.support:gridlayout-v7:${androidLibrariesVersion}", - dynamicAnimation : "com.android.support:support-dynamic-animation:${androidLibrariesVersion}", - constraintLayout : 'com.android.support.constraint:constraint-layout:1.1.3', - multiDex : "com.android.support:multidex:1.0.2", - dataBinding : "com.android.databinding:compiler:${android_plugin_version}", - - //lifecycle - lifecycle : "android.arch.lifecycle:runtime:1.1.1",//not necessary if you are using lifecycle:extensions or lifecycle:common-java8 - lifecycleAPT : "android.arch.lifecycle:compiler:1.1.1",// not needed if you are using the DefaultLifecycleObserver from common-java8 artifact. - lifecycleJava8 : "android.arch.lifecycle:common-java8:1.1.1", - //LiveData, and ViewModel - lifecycleExtensions : "android.arch.lifecycle:extensions:1.1.1",//For LiveData, and ViewModel - liveDataReactiveStreams: "android.arch.lifecycle:reactivestreams:1.1.1",//To use LiveData with ReactiveStreams API - //room - room : "android.arch.persistence.room:runtime:1.0.0", - roomApt : "android.arch.persistence.room:compiler:1.0.0", - roomRxJava2 : "android.arch.persistence.room:rxjava2:1.0.0", - roomGuava : "android.arch.persistence.room:guava:1.1.0-beta3", - //paging - paging : "android.arch.paging:runtime:1.0.0", - - //https://github.com/google/flexbox-layout/ - flexbox : 'com.google.android:flexbox:1.0.0', - ] - - def anko_version = '0.10.7' - def kotlin_version = '1.3.41' - - def kotlinLibraries = [ - //Kotlin - kotlinStdlib : "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version", - kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version", - kotlinCoroutines : 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0',//协程库 - kotlinAndroidCoroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0", - - //https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter - retrofitKotlinAdapter : 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter:1.0.0', - - //https://github.com/android/android-ktx:android_ktx: A set of Kotlin extensions for Android app development - //https://android.github.io/android-ktx/core-ktx/index.html - androidKTX : 'androidx.core:core-ktx:1.0.0', - - //https://github.com/ReactiveX/RxKotlin - rxKotlin : 'io.reactivex.rxjava2:rxkotlin:2.2.0', - - //https://github.com/enbandari/KotlinTuples - tuples : "com.bennyhuo.kotlin:kotlin-tuples:1.0", - //https://github.com/enbandari/ObjectPropertyDelegate - objectPropertyDelegate : "com.bennyhuo.kotlin:opd:1.0-rc-2", - //https://github.com/enbandari/KotlinDeepCopy - deepCopyReflect : "com.bennyhuo.kotlin:deepcopy-reflect:1.0", - deepCopy : "com.bennyhuo.kotlin:deepcopy-annotations:1.1.0", - deepCopyApt : "com.bennyhuo.kotlin:deepcopy-compiler:1.1.0", - //https://github.com/enbandari/ReleasableVar - releasableVar : "com.bennyhuo.kotlin:releasable-nonnull-vars:1.1.0", - - //kotlin functional, https://arrow-kt.io/ - arrowCore : "io.arrow-kt:arrow-core:0.8.2", - - //============================================================================ - //Anko - //============================================================================ - // Anko https://github.com/Kotlin/anko - ankoAll : "org.jetbrains.anko:anko:${anko_version}", - - ankoCommons : "org.jetbrains.anko:anko-commons:$anko_version",// Anko Commons - ankoCommonsV4 : "org.jetbrains.anko:anko-support-v4-commons:$anko_version", - ankoCommonsV7 : "org.jetbrains.anko:anko-appcompat-v7-commons:$anko_version", - - ankoSQLite : "org.jetbrains.anko:anko-sqlite:$anko_version", // Anko SQLite - - // Anko Layouts , sdk15, sdk19, sdk21, sdk23 are also available, 只需要依赖一个sdk - ankoLayoutSDK : "org.jetbrains.anko:anko-sdk27:$anko_version", - ankoLayoutCompatV7 : "org.jetbrains.anko:anko-appcompat-v7:$anko_version", - ankoLayoutCompatV4 : "org.jetbrains.anko:anko-support-v4:$anko_version", - ankoLayoutDesign : "org.jetbrains.anko:anko-design:$anko_version", - ankoLayoutRecyclerView : "org.jetbrains.anko:anko-recyclerview-v7:$anko_version", - ankoLayoutCardView : "org.jetbrains.anko:anko-cardview-v7:$anko_version", - ankoLayoutGridLayout : "org.jetbrains.anko:anko-gridlayout-v7:$anko_version", - ankoLayoutPercent : "org.jetbrains.anko:anko-percent:$anko_version", - - ankoCoroutines : "org.jetbrains.anko:anko-coroutines:$anko_version", //anko Coroutines - ankoLayoutCoroutine : "org.jetbrains.anko:anko-sdk25-coroutines:$anko_version", //Anko Layouts Coroutine listeners - ankoLayoutCompatV7Coroutine: "org.jetbrains.anko:anko-appcompat-v7-coroutines:$anko_version", - ankoDesignCoroutine : "org.jetbrains.anko:anko-design-coroutines:$anko_version", - ankoRecyclerViewCoroutines : "org.jetbrains.anko:anko-recyclerview-v7-coroutines:$anko_version" - ] - - def rxBindingVersion = '2.1.1' - def autoDisposeVersion = '1.0.0-RC3' - def retrofitVersion = '2.5.0' - def daggerVersion = "2.17" - - def thirdLibraries = [ - //============================================================================ - //RxJava - //============================================================================ - //https://github.com/ReactiveX/RxJava - rxJava : "io.reactivex.rxjava2:rxjava:2.2.9", - //https://github.com/ReactiveX/RxAndroid - rxAndroid : 'io.reactivex.rxjava2:rxandroid:2.1.1', - //https://github.com/JakeWharton/RxBinding - rxBinding : "com.jakewharton.rxbinding2:rxbinding:$rxBindingVersion", - rxBindingV4 : "com.jakewharton.rxbinding2:rxbinding-support-v4:$rxBindingVersion", - rxBindingCompat : "com.jakewharton.rxbinding2:rxbinding-appcompat-v7:$rxBindingVersion", - rxBindingDesign : "com.jakewharton.rxbinding2:rxbinding-design:$rxBindingVersion", - rxBindingRecyclerView : "com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:$rxBindingVersion", - //https://github.com/uber/AutoDispose - autoDispose : "com.uber.autodispose:autodispose:$autoDisposeVersion", - autoDisposeLifecycleJDK8 : "com.uber.autodispose:autodispose-lifecycle-jdk8:$autoDisposeVersion", - autoDisposeLifecycleArchcomponents: "com.uber.autodispose:autodispose-android-archcomponents:$autoDisposeVersion", - //https://github.com/uber/RxDogTag - rxDogTag : "com.uber.rxdogtag:rxdogtag:0.1.0", - //RxReplay https://github.com/JakeWharton/RxRelay - rxReplay : 'com.jakewharton.rxrelay2:rxrelay:2.0.0', - - //============================================================================ - //OkHttp&Retrofit&Gson&Glide - //============================================================================ - //https://github.com/square/okhttp & https://github.com/square/retrofit - okHttp : "com.squareup.okhttp3:okhttp:3.12.0", - okHttpLogging : "com.squareup.okhttp3:logging-interceptor:3.12.0", - retrofit : "com.squareup.retrofit2:retrofit:${retrofitVersion}", - retrofitConverterGson : "com.squareup.retrofit2:converter-gson:${retrofitVersion}", - retrofitRxJavaCallAdapter : "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}", - retrofitRxJava2CallAdapter : "com.squareup.retrofit2:adapter-rxjava2:${retrofitVersion}", - - ////https://github.com/google/gson/blob/master/UserGuide.md#TOC-Overview - gson : "com.google.code.gson:gson:2.8.5", - - //https://github.com/bumptech/glide - glide : "com.github.bumptech.glide:glide:4.8.0", - glideApt : 'com.github.bumptech.glide:compiler:4.8.0', - glideOkHttp : 'com.github.bumptech.glide:okhttp3-integration:4.8.0', - - //============================================================================ - //DI - //============================================================================ - //https://github.com/google/dagger - dagger2 : "com.google.dagger:dagger:$daggerVersion", - dagger2Android : "com.google.dagger:dagger-android:$daggerVersion", - dagger2AndroidSupport : "com.google.dagger:dagger-android-support:$daggerVersion", - dagger2Apt : "com.google.dagger:dagger-compiler:$daggerVersion", - dagger2AndroidApt : "com.google.dagger:dagger-android-processor:$daggerVersion", - jsr305 : 'com.google.code.findbugs:jsr305:2.0.1', - - //============================================================================ - //ARouter - //============================================================================ - //https://github.com/alibaba/ARouter,注意:apt arouter 应该放在 apt dagger 后面 - arouter : 'com.alibaba:arouter-api:1.4.1', - arouterAnnotation : 'com.alibaba:arouter-compiler:1.2.2', - - //============================================================================ - //AOP - //============================================================================ - /*aspectJrt*/ - aspectj : 'org.aspectj:aspectjrt:1.8.9', //https://eclipse.org/aspectj/ - - //============================================================================ - //Utils - //============================================================================ - //kv存储:https://github.com/tencent/mmkv、https://mp.weixin.qq.com/s/kTr1GVDCAhs5K7Hq3322FA - mmkv : 'com.tencent:mmkv:1.0.17', - //https://github.com/dmstocking/support-optional - supportOptional : 'com.github.dmstocking:support-optional:1.2', - //日志:https://github.com/JakeWharton/timber - timber : "com.jakewharton.timber:timber:4.5.1", - //发射工具:https://github.com/jOOQ/jOOR - jOOR : "org.jooq:joor-java-6:0.9.7", - //https://github.com/Blankj/AndroidUtilCode - utilcode : 'com.blankj:utilcode:1.23.7', - //https://github.com/yanzhenjie/AndPermission - andPermission : 'com.yanzhenjie.permission:support:2.0.1', - //image compression:https://github.com/Sunzxyong/Tiny - tiny : 'com.zxy.android:tiny:1.1.0', - //zip4j - zip4j : 'net.lingala.zip4j:zip4j:1.3.2', - //JobScheduler:https://github.com/evernote/android-job - androidJob : 'com.evernote:android-job:1.2.0', - //VideoCache:/https://github.com/danikula/AndroidVideoCache - videoCache : 'com.danikula:videocache:2.7.0', - //https://github.com/promeG/TinyPinyin - tinypinyin : 'com.github.promeg:tinypinyin:2.0.3', - //多渠道:https://github.com/Tencent/VasDolly - vasDolly : 'com.leon.channel:helper:2.0.3', - //Android P 反射限制:https://github.com/tiann/FreeReflection - freeReflection : 'me.weishu:free_reflection:1.2.0' - ] - - def debugLibraries = [ - //https://github.com/square/leakcanary - debugLeakCanary : "com.squareup.leakcanary:leakcanary-android:1.6.3", - debugLeakCanaryFragment: "com.squareup.leakcanary:leakcanary-support-fragment:1.6.3", - releaseLeakCanary : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.3", - - //https://github.com/markzhai/AndroidPerformanceMonitor 卡顿监控 - //http://blog.zhaiyifan.cn/2016/01/16/BlockCanaryTransparentPerformanceMonitor/ - debugBlockCanary : "com.github.markzhai:blockcanary-android:1.4.0", - releaseBlockCanary : "com.github.markzhai:blockcanary-no-op:1.4.0", - - //http://facebook.github.io/stetho/ 各种调试工具 - stetho : 'com.facebook.stetho:stetho:1.4.2', - stethoOkhttp3 : 'com.facebook.stetho:stetho-okhttp3:1.4.2', - - //https://github.com/eleme/UETool ui调试工具 - ueTool : 'me.ele:uetool:1.2.1', - - //https://github.com/Kyson/AndroidGodEye 全面的调试工具 - godeyeCore : 'cn.hikyson.godeye:godeye-core:2.1.1', - godeyeMonitor : 'cn.hikyson.godeye:godeye-monitor:2.1.1', - godeyeToolbox : 'cn.hikyson.godeye:godeye-toolbox:2.1.1', - ] - - def uiLibraries = [ - //qmui:https://qmuiteam.com/ - qmui : 'com.qmuiteam:qmui:1.1.3', - //https://github.com/GcsSloop/rclayout - rclayout : 'com.gcssloop.widget:rclayout:1.6.0', - - /*adapter*/ - //https://github.com/drakeet/MultiType - multiType : 'me.drakeet.multitype:multitype:3.4.4', - multiTypeKotlin : 'me.drakeet.multitype:multitype-kotlin:3.4.4', - // https://github.com/Ztiany/WrapperAdapter - wrapperAdapter : 'com.github.Ztiany:WrapperAdapter:3.0.7', - - /*image view about*/ - //https://github.com/chrisbanes/PhotoView - photoView : 'com.github.chrisbanes:PhotoView:2.1.3', - rotatePhotoView :'com.chensl.rotatephotoview:rotatephotoview:1.0.5', - //https://github.com/davemorrissey/subsampling-scale-image-view - subsamplingScaleImageView: 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0', - //https://github.com/hdodenhof/CircleImageView - circleImageView : 'de.hdodenhof:circleimageview:2.1.0', - //https://github.com/vinc3m1/RoundedImageView - roundedImageView : 'com.makeramen:roundedimageview:2.3.0', - //https://github.com/Piasy/BigImageViewer - bigImageViewer : 'com.github.piasy:BigImageViewer:1.5.0', - //https://github.com/Piasy/BigImageViewer - bigImageViewerGlideLoader: 'com.github.piasy:GlideImageLoader:1.5.0', - //https://github.com/iielse/ImageWatcher,高仿微信可拖拽返回 - imageWatcher : 'com.github.iielse:ImageWatcher:1.1.1', - //https://github.com/stfalcon-studio/StfalconImageViewer - stfalconImageviewer : 'com.github.stfalcon:stfalcon-imageviewer:0.1.0', - //https://github.com/gjiazhe/ScrollParallaxImageView - scrollparallaximageview : 'com.gjiazhe:scrollparallaximageview:1.0', - - /*view pager about*/ - //https://github.com/HuanHaiLiuXin/CoolViewPager - coolviewpager : 'com.huanhailiuxin.view:coolviewpager:1.0.0', - //https://github.com/geftimov/android-viewpager-transformers - viewpagerTransformers : 'com.eftimoff:android-viewpager-transformers:1.0.1@aar', - //https://github.com/ogaclejapan/SmartTabLayout - smartTab : 'com.ogaclejapan.smarttablayout:library:1.6.1@aar', - - /*camera*/ - //https://github.com/Fotoapparat/Fotoapparat - fotoapparat : 'io.fotoapparat:fotoapparat:2.5.0', - //https://github.com/CameraKit/camerakit-android - cameraKit : 'com.camerakit:camerakit:1.0.0-beta3.10', - //need kotlin and kotlinx-coroutines-android - camerakitJpegkit : 'com.camerakit:jpegkit:0.1.0', - //https://github.com/natario1/CameraView - cameraView : 'com.otaliastudios:cameraview:1.3.1', - - //picker about - //https://github.com/wdullaer/MaterialDateTimePicker - materialTimePicker : 'com.wdullaer:materialdatetimepicker:3.6.4', - //https://github.com/gzu-liyujiang/AndroidPicker - androidWheelPicker : "com.github.gzu-liyujiang.AndroidPicker:WheelPicker:1.5.6", - //https://github.com/zyyoona7/WheelPicker, it don't support setting max or min date. - wheelWiewPicker : "com.github.zyyoona7:wheelview:1.0.5", - - /*text view*/ - //https://github.com/chenBingX/SuperTextView - superTextView : 'com.github.chenBingX:SuperTextView:v3.1.4', - //https://github.com/iwgang/CountdownView - countdownView : 'com.github.iwgang:countdownview:2.1.3', - - /*shape, tag*/ - //https://github.com/florent37/ShapeOfView, need android x - shapeOfView : 'com.github.florent37:shapeofview:1.4.5', - //https://github.com/whilu/AndroidTagView - androidtagView : 'co.lujun:androidtagview:1.0.6', - //https://github.com/duanhong169/DrawableToolbox - drawableToolbox : "com.github.duanhong169:drawabletoolbox:1.0.5", - - /*recycler view about*/ - //https://github.com/GcsSloop/pager-layoutmanager - pagerlayoutmanager : 'com.gcssloop.recyclerview:pagerlayoutmanager:2.3.2@aar', - //https://github.com/alibaba/vlayout - vlayout : 'com.alibaba.android:vlayout:1.0.4@aar', - //https://github.com/DingMouRen/LayoutManagerGroup - layoutManagerGroup : 'com.github.DingMouRen:LayoutManagerGroup:f68c9712e5', - //https://github.com/lsjwzh/RecyclerViewPager - recyclerViewPager : 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2', - - //system ui manager:https://github.com/DreaminginCodeZH/SystemUiHelper - systemUiHelper : 'me.zhanghai.android.systemuihelper:library:1.0.0', - - //soft input method:https://github.com/yshrsmz/KeyboardVisibilityEvent - keyboardvisibilityevent : 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.0.0', - ] - - def testLibraries = [ - junit : "junit:junit:4.12", - mockito: "org.mockito:mockito-core:1.10.19" - ] - - def repository = new Repository() - repository.androidLibraries = androidLibraries - repository.kotlinLibraries = kotlinLibraries - repository.thirdLibraries = thirdLibraries - repository.debugLibraries = debugLibraries - repository.uiLibraries = uiLibraries - repository.testLibraries = testLibraries - return repository -} \ No newline at end of file diff --git a/lib_base/build.gradle b/lib_base/build.gradle index e18720b..31a9d4c 100644 --- a/lib_base/build.gradle +++ b/lib_base/build.gradle @@ -41,30 +41,8 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - sourceSets { - main { - java.srcDirs += "src/github/java" - res.srcDirs += "src/github/res" - } - } - - project.afterEvaluate { - Task assembleReleaseTask = project.tasks.findByPath("assembleRelease") - if (assembleReleaseTask != null) { - assembleReleaseTask.doLast { - File infile = project.file("build/outputs/aar/") - File outfile = project.file("./release") - project.copy { - from infile - into outfile - } - } - } - } - } - dependencies { api fileTree(dir: 'libs', include: ['*.jar']) @@ -72,18 +50,27 @@ dependencies { testImplementation testLibraries.junit //AndroidSupport - api androidLibraries.androidCompatV4 - api androidLibraries.androidCompatV7 - api androidLibraries.androidRecyclerView - api androidLibraries.androidDesign - api androidLibraries.androidPrecent + api androidLibraries.supportV4 + api androidLibraries.appcompat + api androidLibraries.recyclerview + api androidLibraries.material + api androidLibraries.percentLayout api androidLibraries.constraintLayout + api androidLibraries.annotation //AAC - api androidLibraries.lifecycle - api androidLibraries.lifecycleJava8 - api androidLibraries.lifecycleExtensions - api androidLibraries.liveDataReactiveStreams + api androidLibraries. archRuntime + api androidLibraries. archCommon + api androidLibraries. lifecycleCommon + api androidLibraries. lifecycleCommonJava8 + api androidLibraries. lifecycleRuntimeKtx + api androidLibraries. lifecycleLiveDataCore + api androidLibraries. lifecycleLiveData + api androidLibraries. lifecycleLiveKtx + api androidLibraries. lifecycleViewModel + api androidLibraries. lifecycleViewModelKtx + api androidLibraries. lifecycleExtensions + api androidLibraries. lifecycleReactiveStreams //Kotlin api kotlinLibraries.kotlinStdlib @@ -126,4 +113,4 @@ dependencies { api thirdLibraries.jOOR api thirdLibraries.supportOptional -} +} \ No newline at end of file diff --git a/lib_base/src/main/java/com/android/base/adapter/ItemHelper.java b/lib_base/src/main/java/com/android/base/adapter/ItemHelper.java index 57f9d6c..4be1188 100644 --- a/lib_base/src/main/java/com/android/base/adapter/ItemHelper.java +++ b/lib_base/src/main/java/com/android/base/adapter/ItemHelper.java @@ -1,12 +1,13 @@ package com.android.base.adapter; -import android.support.annotation.IdRes; -import android.support.annotation.NonNull; -import android.support.annotation.StringRes; import android.util.SparseArray; import android.view.View; import android.widget.TextView; +import androidx.annotation.IdRes; +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; + /** * @author Ztiany diff --git a/lib_base/src/main/java/com/android/base/adapter/list/BaseListAdapter.java b/lib_base/src/main/java/com/android/base/adapter/list/BaseListAdapter.java index 6fc5a36..833adec 100644 --- a/lib_base/src/main/java/com/android/base/adapter/list/BaseListAdapter.java +++ b/lib_base/src/main/java/com/android/base/adapter/list/BaseListAdapter.java @@ -1,7 +1,6 @@ package com.android.base.adapter.list; import android.content.Context; -import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -12,6 +11,8 @@ import com.android.base.adapter.DataManager; import java.util.List; +import androidx.annotation.NonNull; + /** * absListView通用的Adapter,注意:只有setDataSource才能替换原有数据源的引用。 * diff --git a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageFragmentAdapter.java b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageFragmentAdapter.java index 5204619..f6d0f06 100644 --- a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageFragmentAdapter.java +++ b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageFragmentAdapter.java @@ -1,13 +1,14 @@ package com.android.base.adapter.pager; import android.content.Context; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; import java.util.ArrayList; import java.util.List; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; + @SuppressWarnings("unused") public class ViewPageFragmentAdapter extends FragmentPagerAdapter { diff --git a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageInfo.java b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageInfo.java index 9cac811..f3f1675 100644 --- a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageInfo.java +++ b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageInfo.java @@ -1,13 +1,15 @@ package com.android.base.adapter.pager; import android.os.Bundle; -import android.support.v4.app.Fragment; + +import androidx.fragment.app.Fragment; + @SuppressWarnings("all") public class ViewPageInfo { - public final Class clazz; - public final Bundle args; - public final String title; + public final Class clazz; + public final Bundle args; + public final String title; public ViewPageInfo(String title, Class clazz, Bundle args) { this.title = title; diff --git a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageStateFragmentAdapter.java b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageStateFragmentAdapter.java index a6a26cb..8f6dd19 100644 --- a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageStateFragmentAdapter.java +++ b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPageStateFragmentAdapter.java @@ -1,13 +1,16 @@ package com.android.base.adapter.pager; import android.content.Context; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; + +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; + public class ViewPageStateFragmentAdapter extends FragmentStatePagerAdapter { private final List mTabs; @@ -29,6 +32,7 @@ public class ViewPageStateFragmentAdapter extends FragmentStatePagerAdapter { return mTabs.size(); } + @NotNull @Override public Fragment getItem(int position) { ViewPageInfo viewPageInfo = mTabs.get(position); @@ -44,5 +48,4 @@ public class ViewPageStateFragmentAdapter extends FragmentStatePagerAdapter { return mTabs; } - -} +} \ No newline at end of file diff --git a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPagerAdapter.java b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPagerAdapter.java index 0719894..af92869 100644 --- a/lib_base/src/main/java/com/android/base/adapter/pager/ViewPagerAdapter.java +++ b/lib_base/src/main/java/com/android/base/adapter/pager/ViewPagerAdapter.java @@ -1,7 +1,5 @@ package com.android.base.adapter.pager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.View; import android.view.ViewGroup; @@ -11,6 +9,9 @@ import com.android.base.utils.common.Checker; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + /** * 如果使用可缩放的 View 作为 pager,可能不适合使用此Adapter * diff --git a/lib_base/src/main/java/com/android/base/adapter/pager/recycler/RecyclingPagerAdapter.java b/lib_base/src/main/java/com/android/base/adapter/pager/recycler/RecyclingPagerAdapter.java index 56f2383..2a2b026 100644 --- a/lib_base/src/main/java/com/android/base/adapter/pager/recycler/RecyclingPagerAdapter.java +++ b/lib_base/src/main/java/com/android/base/adapter/pager/recycler/RecyclingPagerAdapter.java @@ -1,10 +1,11 @@ package com.android.base.adapter.pager.recycler; -import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; +import androidx.viewpager.widget.PagerAdapter; + /** * A {@link PagerAdapter} which behaves like an {@link android.widget.Adapter} with view types and view recycling. * diff --git a/lib_base/src/main/java/com/android/base/app/BaseKit.java b/lib_base/src/main/java/com/android/base/app/BaseKit.java index 39219c9..91d77be 100644 --- a/lib_base/src/main/java/com/android/base/app/BaseKit.java +++ b/lib_base/src/main/java/com/android/base/app/BaseKit.java @@ -4,12 +4,6 @@ import android.app.Activity; import android.app.Application; import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.UiThread; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; import com.android.base.app.dagger.Injectable; import com.android.base.app.fragment.FragmentConfig; @@ -22,6 +16,12 @@ import com.android.base.receiver.NetworkState; import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.AppUtils; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; import dagger.android.AndroidInjection; import dagger.android.support.AndroidSupportInjection; import io.reactivex.Flowable; diff --git a/lib_base/src/main/java/com/android/base/app/aac/AutoClearedValue.kt b/lib_base/src/main/java/com/android/base/app/aac/AutoClearedValue.kt index 2f29cd1..f917cb5 100644 --- a/lib_base/src/main/java/com/android/base/app/aac/AutoClearedValue.kt +++ b/lib_base/src/main/java/com/android/base/app/aac/AutoClearedValue.kt @@ -16,11 +16,11 @@ package com.android.base.app.aac -import android.arch.lifecycle.DefaultLifecycleObserver -import android.arch.lifecycle.Lifecycle -import android.arch.lifecycle.LifecycleOwner -import android.support.v4.app.Fragment -import android.support.v4.app.FragmentActivity +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentActivity +import androidx.lifecycle.DefaultLifecycleObserver +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty diff --git a/lib_base/src/main/java/com/android/base/app/aac/AutoDisposeLiveData.kt b/lib_base/src/main/java/com/android/base/app/aac/AutoDisposeLiveData.kt index 57b9438..b01cbe9 100644 --- a/lib_base/src/main/java/com/android/base/app/aac/AutoDisposeLiveData.kt +++ b/lib_base/src/main/java/com/android/base/app/aac/AutoDisposeLiveData.kt @@ -1,7 +1,7 @@ package com.android.base.app.aac -import android.arch.lifecycle.LiveData -import android.arch.lifecycle.MutableLiveData +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData import com.android.base.data.Resource import com.android.base.rx.subscribeIgnoreError import com.github.dmstocking.optional.java.util.Optional diff --git a/lib_base/src/main/java/com/android/base/app/aac/ResourceLiveData.kt b/lib_base/src/main/java/com/android/base/app/aac/ResourceLiveData.kt index d8553d8..b49cd24 100644 --- a/lib_base/src/main/java/com/android/base/app/aac/ResourceLiveData.kt +++ b/lib_base/src/main/java/com/android/base/app/aac/ResourceLiveData.kt @@ -1,7 +1,7 @@ package com.android.base.app.aac -import android.arch.lifecycle.LiveData -import android.arch.lifecycle.MutableLiveData +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData import com.android.base.data.Resource import com.android.base.rx.subscribeIgnoreError import com.github.dmstocking.optional.java.util.Optional diff --git a/lib_base/src/main/java/com/android/base/app/aac/SingleLiveData.java b/lib_base/src/main/java/com/android/base/app/aac/SingleLiveData.java index f16a126..09be4bb 100644 --- a/lib_base/src/main/java/com/android/base/app/aac/SingleLiveData.java +++ b/lib_base/src/main/java/com/android/base/app/aac/SingleLiveData.java @@ -1,48 +1,50 @@ package com.android.base.app.aac; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.MediatorLiveData; -import android.arch.lifecycle.Observer; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.MediatorLiveData; +import androidx.lifecycle.Observer; import timber.log.Timber; public class SingleLiveData extends MediatorLiveData { private int mVersion = 0; - private final List>> mWrapperObserverList = new ArrayList<>(); + private final List>> mWrapperObserverList = new ArrayList<>(); + @Override - public void observe(@NonNull LifecycleOwner owner, @NonNull Observer observer) { - super.observe(owner, getOrNewObserver(observer, mVersion)); + public void setValue(T value) { + mVersion++; + super.setValue(value); } @Override - public void observeForever(@NonNull Observer observer) { - super.observeForever(getOrNewObserver(observer, mVersion)); + public void observe(@NonNull LifecycleOwner owner, @NonNull Observer observer) { + super.observe(owner, getOrNewObserver(observer, mVersion)); } @Override - public void setValue(T value) { - mVersion++; - super.setValue(value); + public void observeForever(@NonNull Observer observer) { + super.observeForever(getOrNewObserver(observer, mVersion)); } @Override - public void removeObserver(@NonNull Observer observer) { + @SuppressWarnings("unchecked") + public void removeObserver(@NonNull Observer observer) { if (observer instanceof ObserverWrapper) { super.removeObserver(observer); removeWrapper((ObserverWrapper) observer); Timber.d("removeObserver() called with: observer = wrapper = [" + observer + "]"); } else { - ObserverWrapper wrapper = findWrapper(observer); + ObserverWrapper wrapper = findWrapper(observer); Timber.d("removeObserver() called with: observer = [" + observer + "], wrapper = [" + wrapper + "]"); super.removeObserver(wrapper); removeWrapper(wrapper); @@ -50,10 +52,10 @@ public class SingleLiveData extends MediatorLiveData { } private void removeWrapper(ObserverWrapper observer) { - ListIterator>> iterator = mWrapperObserverList.listIterator(); + ListIterator>> iterator = mWrapperObserverList.listIterator(); while (iterator.hasNext()) { - WeakReference> next = iterator.next(); - ObserverWrapper item = next.get(); + WeakReference> next = iterator.next(); + ObserverWrapper item = next.get(); if (item == observer) { iterator.remove(); break; @@ -61,14 +63,14 @@ public class SingleLiveData extends MediatorLiveData { } } - private ObserverWrapper findWrapper(Observer observer) { - ListIterator>> iterator = mWrapperObserverList.listIterator(); + private ObserverWrapper findWrapper(Observer observer) { + ListIterator>> iterator = mWrapperObserverList.listIterator(); - ObserverWrapper target = null; + ObserverWrapper target = null; while (iterator.hasNext()) { - WeakReference> next = iterator.next(); - ObserverWrapper item = next.get(); + WeakReference> next = iterator.next(); + ObserverWrapper item = next.get(); if (item == null) { iterator.remove(); } else if (item.mOrigin == observer) { @@ -79,8 +81,8 @@ public class SingleLiveData extends MediatorLiveData { return target; } - private Observer getOrNewObserver(@NonNull Observer observer, int observerVersion) { - ObserverWrapper wrapper = findWrapper(observer); + private Observer getOrNewObserver(@NonNull Observer observer, int observerVersion) { + ObserverWrapper wrapper = findWrapper(observer); if (wrapper == null) { wrapper = new ObserverWrapper<>(observerVersion, observer); diff --git a/lib_base/src/main/java/com/android/base/app/aac/SingleLiveEvent.java b/lib_base/src/main/java/com/android/base/app/aac/SingleLiveEvent.java index 753aca3..75ebc87 100644 --- a/lib_base/src/main/java/com/android/base/app/aac/SingleLiveEvent.java +++ b/lib_base/src/main/java/com/android/base/app/aac/SingleLiveEvent.java @@ -1,15 +1,16 @@ package com.android.base.app.aac; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.MutableLiveData; -import android.arch.lifecycle.Observer; -import android.support.annotation.MainThread; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.util.Log; import java.util.concurrent.atomic.AtomicBoolean; +import androidx.annotation.MainThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.Observer; + /** * A lifecycle-aware observable that sends only new updates after subscription, used for events like @@ -30,7 +31,7 @@ public class SingleLiveEvent extends MutableLiveData { private final AtomicBoolean mPending = new AtomicBoolean(false); @MainThread - public void observe(@NonNull LifecycleOwner owner, @NonNull final Observer observer) { + public void observe(@NonNull LifecycleOwner owner, @NonNull final Observer observer) { if (hasActiveObservers()) { Log.w(TAG, "Multiple observers registered but only one will be notified of changes."); diff --git a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegate.java b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegate.java index 77d5c20..2ed9de8 100644 --- a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegate.java +++ b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegate.java @@ -3,8 +3,9 @@ package com.android.base.app.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** diff --git a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegateOwner.java b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegateOwner.java index 245ab97..831932b 100644 --- a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegateOwner.java +++ b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegateOwner.java @@ -1,9 +1,10 @@ package com.android.base.app.activity; -import android.support.annotation.UiThread; import com.github.dmstocking.optional.java.util.function.Predicate; +import androidx.annotation.UiThread; + @UiThread @SuppressWarnings("unused") public interface ActivityDelegateOwner { diff --git a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegates.java b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegates.java index f27e187..761ab86 100644 --- a/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegates.java +++ b/lib_base/src/main/java/com/android/base/app/activity/ActivityDelegates.java @@ -2,15 +2,16 @@ package com.android.base.app.activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.annotation.UiThread; -import android.support.v7.app.AppCompatActivity; import com.github.dmstocking.optional.java.util.function.Predicate; import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.annotation.UiThread; +import androidx.appcompat.app.AppCompatActivity; + /** * @author Ztiany * Email: 1169654504@qq.com diff --git a/lib_base/src/main/java/com/android/base/app/activity/BackHandlerHelper.java b/lib_base/src/main/java/com/android/base/app/activity/BackHandlerHelper.java index a4d98d3..52f474e 100644 --- a/lib_base/src/main/java/com/android/base/app/activity/BackHandlerHelper.java +++ b/lib_base/src/main/java/com/android/base/app/activity/BackHandlerHelper.java @@ -1,11 +1,11 @@ package com.android.base.app.activity; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; - import java.util.List; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; + /** *
  *        1.Fragment需要自己处理BackPress事件,如果不处理,就交给子Fragment处理。都不处理则由Activity处理
diff --git a/lib_base/src/main/java/com/android/base/app/activity/BaseActivity.java b/lib_base/src/main/java/com/android/base/app/activity/BaseActivity.java
index b7597ac..48ff010 100644
--- a/lib_base/src/main/java/com/android/base/app/activity/BaseActivity.java
+++ b/lib_base/src/main/java/com/android/base/app/activity/BaseActivity.java
@@ -2,15 +2,15 @@ package com.android.base.app.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.UiThread;
-import android.support.v7.app.AppCompatActivity;
 import android.view.View;
 
 import com.android.base.utils.android.compat.AndroidVersion;
 import com.github.dmstocking.optional.java.util.function.Predicate;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
+import androidx.appcompat.app.AppCompatActivity;
 import timber.log.Timber;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelFactory.java b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelFactory.java
index 87823c0..e2249c9 100644
--- a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelFactory.java
+++ b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelFactory.java
@@ -1,14 +1,15 @@
 package com.android.base.app.dagger;
 
-import android.arch.lifecycle.ViewModel;
-import android.arch.lifecycle.ViewModelProvider;
-import android.support.annotation.NonNull;
 
 import java.util.Map;
 
 import javax.inject.Inject;
 import javax.inject.Provider;
 
+import androidx.annotation.NonNull;
+import androidx.lifecycle.ViewModel;
+import androidx.lifecycle.ViewModelProvider;
+
 /**
  * @author Ztiany
  * Email: ztiany3@gmail.com
diff --git a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelKey.java b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelKey.java
index fef7306..730e95b 100644
--- a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelKey.java
+++ b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelKey.java
@@ -1,7 +1,7 @@
 package com.android.base.app.dagger;
 
-import android.arch.lifecycle.ViewModel;
 
+import androidx.lifecycle.ViewModel;
 import dagger.MapKey;
 import kotlin.annotation.AnnotationTarget;
 import kotlin.annotation.MustBeDocumented;
@@ -15,4 +15,5 @@ import kotlin.annotation.Target;
 public @interface ViewModelKey {
 
     Class value();
+
 }
\ No newline at end of file
diff --git a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelModule.java b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelModule.java
index e4ea530..81d0159 100644
--- a/lib_base/src/main/java/com/android/base/app/dagger/ViewModelModule.java
+++ b/lib_base/src/main/java/com/android/base/app/dagger/ViewModelModule.java
@@ -1,7 +1,6 @@
 package com.android.base.app.dagger;
 
-import android.arch.lifecycle.ViewModelProvider;
-
+import androidx.lifecycle.ViewModelProvider;
 import dagger.Binds;
 import dagger.Module;
 
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseDialogFragment.java b/lib_base/src/main/java/com/android/base/app/fragment/BaseDialogFragment.java
index b4bc83e..87a2b7e 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseDialogFragment.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseDialogFragment.java
@@ -3,11 +3,6 @@ package com.android.base.app.fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.StringRes;
-import android.support.annotation.UiThread;
-import android.support.v7.app.AppCompatDialogFragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -18,6 +13,11 @@ import com.android.base.app.activity.OnBackPressListener;
 import com.android.base.app.ui.LoadingView;
 import com.github.dmstocking.optional.java.util.function.Predicate;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.StringRes;
+import androidx.annotation.UiThread;
+import androidx.appcompat.app.AppCompatDialogFragment;
 import timber.log.Timber;
 
 /**
@@ -108,7 +108,7 @@ public class BaseDialogFragment extends AppCompatDialogFragment implements Loadi
     }
 
     /**
-     * View is prepared, If {@link android.support.v4.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle)} return same layout, it will be called once
+     * View is prepared, If {@link androidx.fragment.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle)} return same layout, it will be called once
      *
      * @param view view of fragment
      */
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseFragment.java b/lib_base/src/main/java/com/android/base/app/fragment/BaseFragment.java
index 3c43aae..1574d36 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseFragment.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseFragment.java
@@ -3,11 +3,6 @@ package com.android.base.app.fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.StringRes;
-import android.support.annotation.UiThread;
-import android.support.v4.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -19,6 +14,11 @@ import com.android.base.app.activity.OnBackPressListener;
 import com.android.base.app.ui.LoadingView;
 import com.github.dmstocking.optional.java.util.function.Predicate;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.StringRes;
+import androidx.annotation.UiThread;
+import androidx.fragment.app.Fragment;
 import timber.log.Timber;
 
 /**
@@ -119,7 +119,7 @@ public class BaseFragment extends Fragment implements LoadingView, OnBackPressLi
     }
 
     /**
-     * View is prepared, If {@link android.support.v4.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle)} return same layout, it will be called once
+     * View is prepared, If {@link androidx.fragment.app.Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle)} return same layout, it will be called once
      *
      * @param view view of fragment
      */
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseListFragment.java b/lib_base/src/main/java/com/android/base/app/fragment/BaseListFragment.java
index 1658b14..f1a4349 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseListFragment.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseListFragment.java
@@ -1,9 +1,6 @@
 package com.android.base.app.fragment;
 
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.RecyclerView;
 
 import com.android.base.adapter.DataManager;
 import com.android.base.app.ui.AutoPageNumber;
@@ -15,6 +12,10 @@ import com.ztiany.loadmore.adapter.WrapperAdapter;
 
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.RecyclerView;
+
 /**
  * 通用的RecyclerView列表界面:支持下拉刷新和加载更多。
  *
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseListV2Fragment.kt b/lib_base/src/main/java/com/android/base/app/fragment/BaseListV2Fragment.kt
index 57d15de..158d980 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseListV2Fragment.kt
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseListV2Fragment.kt
@@ -8,7 +8,7 @@ import com.android.base.app.ui.RefreshListLayout
 import com.android.base.app.ui.StateLayoutConfig
 
 /**
- * 区别于 [BaseListFragment] 只能支持 RecyclerView。[BaseListFragment] 采用包装 [android.support.v7.widget.RecyclerView.Adapter] 的方式,
+ * 区别于 [BaseListFragment] 只能支持 RecyclerView。[BaseListFragment] 采用包装 [androidx.recyclerview.widget.RecyclerView.Adapter] 的方式,
  * 在底部添加 load more view 的 item,来实现加载更多。BaseListV2Fragment 没有采用此种方式,所以你使用的刷新视图应该是支持这下来刷新和加载更多功能的。
  *
  * 在调用BaseListV2Fragment [onActivityCreated] 之前,你应该设置好 [dataManager]。
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseStateDialogFragment.java b/lib_base/src/main/java/com/android/base/app/fragment/BaseStateDialogFragment.java
index c61db2c..b7cfe5e 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseStateDialogFragment.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseStateDialogFragment.java
@@ -1,14 +1,15 @@
 package com.android.base.app.fragment;
 
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
 import android.view.View;
 
 import com.android.base.app.ui.RefreshStateLayout;
 import com.android.base.app.ui.RefreshView;
 import com.android.base.app.ui.StateLayoutConfig;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
 /**
  * @author Ztiany
  * date :   2016-03-19 23:09
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/BaseStateFragment.java b/lib_base/src/main/java/com/android/base/app/fragment/BaseStateFragment.java
index a6b55f9..27cc42f 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/BaseStateFragment.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/BaseStateFragment.java
@@ -1,14 +1,15 @@
 package com.android.base.app.fragment;
 
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
 import android.view.View;
 
 import com.android.base.app.ui.RefreshStateLayout;
 import com.android.base.app.ui.RefreshView;
 import com.android.base.app.ui.StateLayoutConfig;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
 /**
  * 
  *          1: 支持显示{CONTENT、LOADING、ERROR、EMPTY}四种布局、支持下拉刷新
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegate.java b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegate.java
index e4d00ae..9a1c2b0 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegate.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegate.java
@@ -3,11 +3,12 @@ package com.android.base.app.fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
 import android.view.View;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
 public interface FragmentDelegate {
 
     /**
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegateOwner.java b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegateOwner.java
index 0aca2a8..0532150 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegateOwner.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegateOwner.java
@@ -1,9 +1,10 @@
 package com.android.base.app.fragment;
 
-import android.support.annotation.UiThread;
 
 import com.github.dmstocking.optional.java.util.function.Predicate;
 
+import androidx.annotation.UiThread;
+
 @UiThread
 public interface FragmentDelegateOwner {
 
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegates.java b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegates.java
index 9de2fd1..d4155bf 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegates.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/FragmentDelegates.java
@@ -3,10 +3,6 @@ package com.android.base.app.fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.UiThread;
-import android.support.v4.app.Fragment;
 import android.view.View;
 
 import com.github.dmstocking.optional.java.util.function.Predicate;
@@ -14,6 +10,11 @@ import com.github.dmstocking.optional.java.util.function.Predicate;
 import java.util.ArrayList;
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
+import androidx.fragment.app.Fragment;
+
 
 @UiThread
 final class FragmentDelegates implements FragmentDelegate, FragmentDelegateOwner {
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/FragmentInfo.java b/lib_base/src/main/java/com/android/base/app/fragment/FragmentInfo.java
index 935f581..f464a1c 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/FragmentInfo.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/FragmentInfo.java
@@ -2,7 +2,7 @@ package com.android.base.app.fragment;
 
 import android.content.Context;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import androidx.fragment.app.Fragment;
 
 import java.lang.ref.WeakReference;
 
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/Fragments.kt b/lib_base/src/main/java/com/android/base/app/fragment/Fragments.kt
index 48c40fc..ea080bb 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/Fragments.kt
+++ b/lib_base/src/main/java/com/android/base/app/fragment/Fragments.kt
@@ -3,12 +3,12 @@
 package com.android.base.app.fragment
 
 
-import android.support.annotation.NonNull
-import android.support.v4.app.Fragment
-import android.support.v4.app.FragmentActivity
-import android.support.v4.app.FragmentManager
-import android.support.v4.app.FragmentTransaction
 import android.view.View
+import androidx.annotation.NonNull
+import androidx.fragment.app.Fragment
+import androidx.fragment.app.FragmentActivity
+import androidx.fragment.app.FragmentManager
+import androidx.fragment.app.FragmentTransaction
 import com.android.base.app.activity.ActivityDelegate
 import com.android.base.app.activity.ActivityDelegateOwner
 import com.android.base.app.activity.ActivityStatus
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/LazyDelegate.java b/lib_base/src/main/java/com/android/base/app/fragment/LazyDelegate.java
index 2b6af63..cb1a9ef 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/LazyDelegate.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/LazyDelegate.java
@@ -1,11 +1,12 @@
 package com.android.base.app.fragment;
 
 import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
 import android.view.View;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
 /**
  * 
  *    在ViewPager中实现懒加载的Fragment
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/RefreshableStateLayoutImpl.java b/lib_base/src/main/java/com/android/base/app/fragment/RefreshableStateLayoutImpl.java
index da3b8a5..261c375 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/RefreshableStateLayoutImpl.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/RefreshableStateLayoutImpl.java
@@ -1,7 +1,6 @@
 package com.android.base.app.fragment;
 
 import android.graphics.drawable.Drawable;
-import android.support.annotation.DrawableRes;
 import android.view.View;
 
 import com.android.base.app.ui.OnRetryActionListener;
@@ -12,6 +11,8 @@ import com.android.base.app.ui.StateLayout;
 import com.android.base.app.ui.StateLayoutConfig;
 import com.android.base.widget.StateProcessor;
 
+import androidx.annotation.DrawableRes;
+
 import static com.android.base.app.ui.CommonId.REFRESH_ID;
 import static com.android.base.app.ui.CommonId.STATE_ID;
 
diff --git a/lib_base/src/main/java/com/android/base/app/fragment/TabManager.java b/lib_base/src/main/java/com/android/base/app/fragment/TabManager.java
index fee2ea4..3a12bca 100644
--- a/lib_base/src/main/java/com/android/base/app/fragment/TabManager.java
+++ b/lib_base/src/main/java/com/android/base/app/fragment/TabManager.java
@@ -2,14 +2,15 @@ package com.android.base.app.fragment;
 
 import android.content.Context;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
 public abstract class TabManager {
 
     @SuppressWarnings("WeakerAccess") public static final int ATTACH_DETACH = 1;
diff --git a/lib_base/src/main/java/com/android/base/app/mvp/AbstractPresenter.kt b/lib_base/src/main/java/com/android/base/app/mvp/AbstractPresenter.kt
index edc66f6..68c4b04 100644
--- a/lib_base/src/main/java/com/android/base/app/mvp/AbstractPresenter.kt
+++ b/lib_base/src/main/java/com/android/base/app/mvp/AbstractPresenter.kt
@@ -1,6 +1,6 @@
 package com.android.base.app.mvp
 
-import android.support.annotation.CallSuper
+import androidx.annotation.CallSuper
 import java.lang.ref.WeakReference
 
 abstract class AbstractPresenter : IPresenter {
diff --git a/lib_base/src/main/java/com/android/base/app/mvp/PresenterBinder.kt b/lib_base/src/main/java/com/android/base/app/mvp/PresenterBinder.kt
index 12214ce..f5ecd70 100644
--- a/lib_base/src/main/java/com/android/base/app/mvp/PresenterBinder.kt
+++ b/lib_base/src/main/java/com/android/base/app/mvp/PresenterBinder.kt
@@ -1,7 +1,7 @@
 package com.android.base.app.mvp
 
 import android.os.Bundle
-import android.support.v4.app.Fragment
+import androidx.fragment.app.Fragment
 import android.view.View
 import com.android.base.app.fragment.FragmentDelegate
 import com.android.base.app.fragment.FragmentDelegateOwner
diff --git a/lib_base/src/main/java/com/android/base/app/mvp/RxPresenter.kt b/lib_base/src/main/java/com/android/base/app/mvp/RxPresenter.kt
index 65be98b..e5e19b5 100644
--- a/lib_base/src/main/java/com/android/base/app/mvp/RxPresenter.kt
+++ b/lib_base/src/main/java/com/android/base/app/mvp/RxPresenter.kt
@@ -1,6 +1,7 @@
 package com.android.base.app.mvp
 
 import android.support.annotation.CallSuper
+import androidx.annotation.CallSuper
 import com.android.base.rx.AutoDisposeLifecycleScopeProviderEx
 import com.uber.autodispose.lifecycle.CorrespondingEventsFunction
 import com.uber.autodispose.lifecycle.LifecycleEndedException
diff --git a/lib_base/src/main/java/com/android/base/app/mvvm/ArchViewModel.kt b/lib_base/src/main/java/com/android/base/app/mvvm/ArchViewModel.kt
index ae2ca25..3eb9120 100644
--- a/lib_base/src/main/java/com/android/base/app/mvvm/ArchViewModel.kt
+++ b/lib_base/src/main/java/com/android/base/app/mvvm/ArchViewModel.kt
@@ -1,7 +1,8 @@
 package com.android.base.app.mvvm
 
-import android.arch.lifecycle.ViewModel
-import android.support.annotation.CallSuper
+
+import androidx.annotation.CallSuper
+import androidx.lifecycle.ViewModel
 import com.android.base.rx.AutoDisposeLifecycleScopeProviderEx
 import com.uber.autodispose.lifecycle.CorrespondingEventsFunction
 import com.uber.autodispose.lifecycle.LifecycleEndedException
diff --git a/lib_base/src/main/java/com/android/base/app/mvvm/ViewModelEx.kt b/lib_base/src/main/java/com/android/base/app/mvvm/ViewModelEx.kt
index 2079d2f..60270d9 100644
--- a/lib_base/src/main/java/com/android/base/app/mvvm/ViewModelEx.kt
+++ b/lib_base/src/main/java/com/android/base/app/mvvm/ViewModelEx.kt
@@ -3,7 +3,7 @@ package com.android.base.app.mvvm
 import android.arch.lifecycle.ViewModel
 import android.arch.lifecycle.ViewModelProvider
 import android.arch.lifecycle.ViewModelProviders
-import android.support.v4.app.Fragment
+import androidx.fragment.app.Fragment
 import android.support.v4.app.FragmentActivity
 
 inline fun  Fragment.getViewModel(factory: ViewModelProvider.Factory? = null): VM {
diff --git a/lib_base/src/main/java/com/android/base/app/ui/LoadingView.java b/lib_base/src/main/java/com/android/base/app/ui/LoadingView.java
index 078d760..f7b0895 100644
--- a/lib_base/src/main/java/com/android/base/app/ui/LoadingView.java
+++ b/lib_base/src/main/java/com/android/base/app/ui/LoadingView.java
@@ -1,6 +1,7 @@
 package com.android.base.app.ui;
 
-import android.support.annotation.StringRes;
+
+import androidx.annotation.StringRes;
 
 /**
  * 显示通用的 LoadingDialog 和 Message
diff --git a/lib_base/src/main/java/com/android/base/app/ui/RefreshViewFactory.java b/lib_base/src/main/java/com/android/base/app/ui/RefreshViewFactory.java
index f7009d0..de9b499 100644
--- a/lib_base/src/main/java/com/android/base/app/ui/RefreshViewFactory.java
+++ b/lib_base/src/main/java/com/android/base/app/ui/RefreshViewFactory.java
@@ -1,8 +1,9 @@
 package com.android.base.app.ui;
 
-import android.support.v4.widget.SwipeRefreshLayout;
 import android.view.View;
 
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
+
 /**
  * RefreshView Factory
  *
diff --git a/lib_base/src/main/java/com/android/base/app/ui/StateLayoutConfig.java b/lib_base/src/main/java/com/android/base/app/ui/StateLayoutConfig.java
index d2f029b..12fdcb7 100644
--- a/lib_base/src/main/java/com/android/base/app/ui/StateLayoutConfig.java
+++ b/lib_base/src/main/java/com/android/base/app/ui/StateLayoutConfig.java
@@ -1,14 +1,15 @@
 package com.android.base.app.ui;
 
 import android.graphics.drawable.Drawable;
-import android.support.annotation.DrawableRes;
-import android.support.annotation.IntDef;
 
 import com.android.base.widget.StateProcessor;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 
+import androidx.annotation.DrawableRes;
+import androidx.annotation.IntDef;
+
 /**
  * @author Ztiany
  * Email: 1169654504@qq.com
diff --git a/lib_base/src/main/java/com/android/base/app/ui/SwipeRefreshView.java b/lib_base/src/main/java/com/android/base/app/ui/SwipeRefreshView.java
index 5650b6c..a8af188 100644
--- a/lib_base/src/main/java/com/android/base/app/ui/SwipeRefreshView.java
+++ b/lib_base/src/main/java/com/android/base/app/ui/SwipeRefreshView.java
@@ -1,6 +1,7 @@
 package com.android.base.app.ui;
 
-import android.support.v4.widget.SwipeRefreshLayout;
+
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
 class SwipeRefreshView implements RefreshView {
 
diff --git a/lib_base/src/main/java/com/android/base/data/Resource.java b/lib_base/src/main/java/com/android/base/data/Resource.java
index 251679e..5996635 100644
--- a/lib_base/src/main/java/com/android/base/data/Resource.java
+++ b/lib_base/src/main/java/com/android/base/data/Resource.java
@@ -1,8 +1,8 @@
 package com.android.base.data;
 
 
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/imageloader/GlideImageLoader.java b/lib_base/src/main/java/com/android/base/imageloader/GlideImageLoader.java
index df71392..7ab3594 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/GlideImageLoader.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/GlideImageLoader.java
@@ -3,9 +3,6 @@ package com.android.base.imageloader;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.drawable.Drawable;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
 import android.view.View;
 import android.widget.ImageView;
 
@@ -21,6 +18,10 @@ import com.bumptech.glide.request.transition.Transition;
 
 import java.util.concurrent.ExecutionException;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
 class GlideImageLoader implements ImageLoader {
 
     private boolean canFragmentLoadImage(Fragment fragment) {
diff --git a/lib_base/src/main/java/com/android/base/imageloader/ImageLoader.java b/lib_base/src/main/java/com/android/base/imageloader/ImageLoader.java
index ccd0c27..f63e51f 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/ImageLoader.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/ImageLoader.java
@@ -3,14 +3,15 @@ package com.android.base.imageloader;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.drawable.Drawable;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.UiThread;
-import android.support.annotation.WorkerThread;
-import android.support.v4.app.Fragment;
 import android.view.View;
 import android.widget.ImageView;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.UiThread;
+import androidx.annotation.WorkerThread;
+import androidx.fragment.app.Fragment;
+
 // @formatter:off
 public interface ImageLoader {
 
diff --git a/lib_base/src/main/java/com/android/base/imageloader/ProgressGlideModule.java b/lib_base/src/main/java/com/android/base/imageloader/ProgressGlideModule.java
index 04e20cc..b0695c2 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/ProgressGlideModule.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/ProgressGlideModule.java
@@ -1,8 +1,6 @@
 package com.android.base.imageloader;
 
 import android.content.Context;
-import android.support.annotation.CallSuper;
-import android.support.annotation.NonNull;
 
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.Registry;
@@ -12,6 +10,8 @@ import com.bumptech.glide.module.AppGlideModule;
 
 import java.io.InputStream;
 
+import androidx.annotation.CallSuper;
+import androidx.annotation.NonNull;
 import okhttp3.OkHttpClient;
 
 public class ProgressGlideModule extends AppGlideModule {
diff --git a/lib_base/src/main/java/com/android/base/imageloader/ProgressInfo.java b/lib_base/src/main/java/com/android/base/imageloader/ProgressInfo.java
index a3b8009..9080487 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/ProgressInfo.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/ProgressInfo.java
@@ -1,7 +1,7 @@
 package com.android.base.imageloader;
 
 
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
 
 public class ProgressInfo {
 
diff --git a/lib_base/src/main/java/com/android/base/imageloader/ProgressManager.java b/lib_base/src/main/java/com/android/base/imageloader/ProgressManager.java
index 54d30c8..63a3df6 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/ProgressManager.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/ProgressManager.java
@@ -2,8 +2,6 @@ package com.android.base.imageloader;
 
 import android.os.Handler;
 import android.os.Looper;
-import android.support.annotation.NonNull;
-import android.support.annotation.UiThread;
 
 import com.android.base.utils.common.Checker;
 import com.android.base.utils.common.StringChecker;
@@ -15,6 +13,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.UiThread;
 import okhttp3.Interceptor;
 import okhttp3.OkHttpClient;
 import okhttp3.Response;
diff --git a/lib_base/src/main/java/com/android/base/imageloader/ProgressResponseBody.java b/lib_base/src/main/java/com/android/base/imageloader/ProgressResponseBody.java
index 932de64..24c5732 100644
--- a/lib_base/src/main/java/com/android/base/imageloader/ProgressResponseBody.java
+++ b/lib_base/src/main/java/com/android/base/imageloader/ProgressResponseBody.java
@@ -1,10 +1,10 @@
 package com.android.base.imageloader;
 
 import android.os.SystemClock;
-import android.support.annotation.NonNull;
 
 import java.io.IOException;
 
+import androidx.annotation.NonNull;
 import okhttp3.MediaType;
 import okhttp3.ResponseBody;
 import okio.Buffer;
diff --git a/lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java b/lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java
index 6bb7937..1efc6f2 100644
--- a/lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java
+++ b/lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java
@@ -1,8 +1,9 @@
 package com.android.base.interfaces;
 
-import android.support.annotation.NonNull;
 import android.view.View;
 
+import androidx.annotation.NonNull;
+
 
 public abstract class OnItemClickListener implements View.OnClickListener {
 
diff --git a/lib_base/src/main/java/com/android/base/interfaces/adapter/DrawerListenerAdapter.java b/lib_base/src/main/java/com/android/base/interfaces/adapter/DrawerListenerAdapter.java
index f54d556..c3806fe 100644
--- a/lib_base/src/main/java/com/android/base/interfaces/adapter/DrawerListenerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/interfaces/adapter/DrawerListenerAdapter.java
@@ -1,21 +1,24 @@
 package com.android.base.interfaces.adapter;
 
-import android.support.v4.widget.DrawerLayout;
 import android.view.View;
 
+import org.jetbrains.annotations.NotNull;
+
+import androidx.drawerlayout.widget.DrawerLayout;
+
 
 public interface DrawerListenerAdapter extends DrawerLayout.DrawerListener {
 
     @Override
-    default void onDrawerSlide(View drawerView, float slideOffset) {
+    default void onDrawerSlide(@NotNull View drawerView, float slideOffset) {
     }
 
     @Override
-    default void onDrawerOpened(View drawerView) {
+    default void onDrawerOpened(@NotNull View drawerView) {
     }
 
     @Override
-    default void onDrawerClosed(View drawerView) {
+    default void onDrawerClosed(@NotNull View drawerView) {
     }
 
     @Override
diff --git a/lib_base/src/main/java/com/android/base/interfaces/adapter/OnPageChangeListenerAdapter.java b/lib_base/src/main/java/com/android/base/interfaces/adapter/OnPageChangeListenerAdapter.java
index b7f81af..5ef966c 100644
--- a/lib_base/src/main/java/com/android/base/interfaces/adapter/OnPageChangeListenerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/interfaces/adapter/OnPageChangeListenerAdapter.java
@@ -1,6 +1,7 @@
 package com.android.base.interfaces.adapter;
 
-import android.support.v4.view.ViewPager;
+
+import androidx.viewpager.widget.ViewPager;
 
 /**
  * @author Ztiany
diff --git a/lib_base/src/main/java/com/android/base/interfaces/adapter/OnTabSelectedListenerAdapter.java b/lib_base/src/main/java/com/android/base/interfaces/adapter/OnTabSelectedListenerAdapter.java
index c386e7a..9ab1f68 100644
--- a/lib_base/src/main/java/com/android/base/interfaces/adapter/OnTabSelectedListenerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/interfaces/adapter/OnTabSelectedListenerAdapter.java
@@ -1,6 +1,7 @@
 package com.android.base.interfaces.adapter;
 
-import android.support.design.widget.TabLayout;
+
+import com.google.android.material.tabs.TabLayout;
 
 public interface OnTabSelectedListenerAdapter extends TabLayout.OnTabSelectedListener {
 
diff --git a/lib_base/src/main/java/com/android/base/interfaces/adapter/TransitionListenerAdapter.java b/lib_base/src/main/java/com/android/base/interfaces/adapter/TransitionListenerAdapter.java
index 7d4bafb..f1a0b29 100644
--- a/lib_base/src/main/java/com/android/base/interfaces/adapter/TransitionListenerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/interfaces/adapter/TransitionListenerAdapter.java
@@ -1,9 +1,10 @@
 package com.android.base.interfaces.adapter;
 
 import android.os.Build;
-import android.support.annotation.RequiresApi;
 import android.transition.Transition;
 
+import androidx.annotation.RequiresApi;
+
 
 @RequiresApi(api = Build.VERSION_CODES.KITKAT)
 public interface TransitionListenerAdapter extends Transition.TransitionListener {
diff --git a/lib_base/src/main/java/com/android/base/kotlin/AttrStyleEx.kt b/lib_base/src/main/java/com/android/base/kotlin/AttrStyleEx.kt
index 424905b..2949ea6 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/AttrStyleEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/AttrStyleEx.kt
@@ -3,11 +3,12 @@ package com.android.base.kotlin
 import android.content.Context
 import android.content.ContextWrapper
 import android.content.res.TypedArray
-import android.support.annotation.AttrRes
-import android.support.annotation.StyleRes
+
 import android.util.TypedValue
 import android.view.ContextThemeWrapper
 import android.view.View
+import androidx.annotation.AttrRes
+import androidx.annotation.StyleRes
 
 /** 属性相关扩展:https://github.com/Kotlin/anko/issues/16*/
 val View.contextThemeWrapper: ContextThemeWrapper
diff --git a/lib_base/src/main/java/com/android/base/kotlin/ContextEx.kt b/lib_base/src/main/java/com/android/base/kotlin/ContextEx.kt
index 7efe49b..27b3479 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/ContextEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/ContextEx.kt
@@ -2,9 +2,9 @@ package com.android.base.kotlin
 
 import android.content.Context
 import android.graphics.drawable.Drawable
-import android.support.annotation.ColorRes
-import android.support.annotation.DrawableRes
-import android.support.v4.content.ContextCompat
+import androidx.annotation.ColorRes
+import androidx.annotation.DrawableRes
+import androidx.core.content.ContextCompat
 
 fun Context.colorFromId(@ColorRes id: Int): Int {
     return ContextCompat.getColor(this, id)
diff --git a/lib_base/src/main/java/com/android/base/kotlin/FragmentEx.kt b/lib_base/src/main/java/com/android/base/kotlin/FragmentEx.kt
index ae21e7f..ddde674 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/FragmentEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/FragmentEx.kt
@@ -1,10 +1,10 @@
 package com.android.base.kotlin
 
 import android.graphics.drawable.Drawable
-import android.support.annotation.ColorRes
-import android.support.annotation.DrawableRes
-import android.support.v4.app.Fragment
-import android.support.v4.content.ContextCompat
+import androidx.annotation.ColorRes
+import androidx.annotation.DrawableRes
+import androidx.core.content.ContextCompat
+import androidx.fragment.app.Fragment
 
 
 fun Fragment.colorFromId(@ColorRes colorRes: Int): Int {
diff --git a/lib_base/src/main/java/com/android/base/kotlin/LiveDataEx.kt b/lib_base/src/main/java/com/android/base/kotlin/LiveDataEx.kt
index 610a2d0..9829b2a 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/LiveDataEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/LiveDataEx.kt
@@ -1,6 +1,6 @@
 package com.android.base.kotlin
 
-import android.arch.lifecycle.MutableLiveData
+import androidx.lifecycle.MutableLiveData
 
 fun  MutableLiveData.init(t: T): MutableLiveData {
     this.postValue(t)
diff --git a/lib_base/src/main/java/com/android/base/kotlin/MenuEx.kt b/lib_base/src/main/java/com/android/base/kotlin/MenuEx.kt
index 2601519..b9f483e 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/MenuEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/MenuEx.kt
@@ -1,18 +1,18 @@
 package com.android.base.kotlin
 
-import android.support.v7.widget.PopupMenu
 import android.view.Menu
 import android.view.MenuItem
+import androidx.appcompat.widget.PopupMenu
 
 fun PopupMenu.setMenus(items: Array): PopupMenu {
-    for (i in 0 until items.size) {
+    for (i in items.indices) {
         menu.add(Menu.NONE, i, i, items[i])
     }
     return this
 }
 
 fun PopupMenu.setMenus(items: Array, ids: IntArray): PopupMenu {
-    for (i in 0 until items.size) {
+    for (i in items.indices) {
         menu.add(Menu.NONE, ids[i], i, items[i])
     }
     return this
diff --git a/lib_base/src/main/java/com/android/base/kotlin/TextViewEx.kt b/lib_base/src/main/java/com/android/base/kotlin/TextViewEx.kt
index 0cfe957..62fd841 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/TextViewEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/TextViewEx.kt
@@ -1,12 +1,12 @@
 package com.android.base.kotlin
 
 import android.graphics.drawable.Drawable
-import android.support.annotation.DrawableRes
 import android.text.Editable
 import android.text.TextWatcher
 import android.widget.Button
 import android.widget.EditText
 import android.widget.TextView
+import androidx.annotation.DrawableRes
 import com.android.base.interfaces.adapter.TextWatcherAdapter
 
 inline fun TextView.textWatcher(init: KTextWatcher.() -> Unit) = addTextChangedListener(KTextWatcher().apply(init))
diff --git a/lib_base/src/main/java/com/android/base/kotlin/ViewEx.kt b/lib_base/src/main/java/com/android/base/kotlin/ViewEx.kt
index 6dded22..948529a 100644
--- a/lib_base/src/main/java/com/android/base/kotlin/ViewEx.kt
+++ b/lib_base/src/main/java/com/android/base/kotlin/ViewEx.kt
@@ -1,17 +1,18 @@
 package com.android.base.kotlin
 
 import android.graphics.drawable.Drawable
-import android.support.annotation.ColorRes
-import android.support.annotation.DrawableRes
-import android.support.v4.content.ContextCompat
-import android.support.v4.view.ViewCompat
-import android.support.v4.widget.NestedScrollView
+
+import androidx.fragment.app.Fragment
 import android.view.View
 import android.view.View.FOCUS_DOWN
 import android.view.View.FOCUS_UP
 import android.view.ViewGroup
 import android.view.ViewTreeObserver
 import android.widget.ScrollView
+import androidx.annotation.*
+import androidx.core.content.ContextCompat
+import androidx.core.view.ViewCompat
+import androidx.core.widget.NestedScrollView
 import com.android.base.rx.subscribeIgnoreError
 import com.android.base.utils.android.ViewUtils
 import com.android.base.utils.android.compat.AndroidVersion.atLeast
diff --git a/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java b/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java
index 3fe478f..e2115ad 100644
--- a/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java
+++ b/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java
@@ -3,10 +3,10 @@ package com.android.base.permission;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
 import timber.log.Timber;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java
index 2ff9531..b9a7ab9 100644
--- a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java
+++ b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java
@@ -1,17 +1,18 @@
 package com.android.base.permission;
 
-import android.arch.lifecycle.DefaultLifecycleObserver;
-import android.arch.lifecycle.LifecycleOwner;
+
 import android.content.Intent;
-import android.support.annotation.NonNull;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
 
 import com.android.base.utils.android.ActFragWrapper;
 
 import java.util.Arrays;
 
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
+import androidx.lifecycle.DefaultLifecycleObserver;
+import androidx.lifecycle.LifecycleOwner;
 import timber.log.Timber;
 
 import static com.android.base.permission.PermissionCode.PERMISSION_REQUESTER_CODE;
diff --git a/lib_base/src/main/java/com/android/base/permission/DefaultPermissionUIProvider.java b/lib_base/src/main/java/com/android/base/permission/DefaultPermissionUIProvider.java
index 61face0..6041fd0 100644
--- a/lib_base/src/main/java/com/android/base/permission/DefaultPermissionUIProvider.java
+++ b/lib_base/src/main/java/com/android/base/permission/DefaultPermissionUIProvider.java
@@ -3,13 +3,14 @@ package com.android.base.permission;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.graphics.Color;
-import android.support.v7.app.AlertDialog;
 
 import com.android.base.R;
 import com.blankj.utilcode.util.ToastUtils;
 
 import org.jetbrains.annotations.NotNull;
 
+import androidx.appcompat.app.AlertDialog;
+
 import static com.android.base.permission.PermissionUtils.createPermissionAskAgainText;
 import static com.android.base.permission.PermissionUtils.createPermissionDeniedTip;
 import static com.android.base.permission.PermissionUtils.createPermissionRationaleText;
diff --git a/lib_base/src/main/java/com/android/base/permission/EasyPermissions.java b/lib_base/src/main/java/com/android/base/permission/EasyPermissions.java
index c89de2d..c2e9184 100644
--- a/lib_base/src/main/java/com/android/base/permission/EasyPermissions.java
+++ b/lib_base/src/main/java/com/android/base/permission/EasyPermissions.java
@@ -23,14 +23,14 @@ import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Build;
 import android.provider.Settings;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.app.Fragment;
-import android.support.v4.content.ContextCompat;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.fragment.app.Fragment;
 import timber.log.Timber;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/permission/IPermissionUIProvider.java b/lib_base/src/main/java/com/android/base/permission/IPermissionUIProvider.java
index fc25fe6..dbbd02c 100644
--- a/lib_base/src/main/java/com/android/base/permission/IPermissionUIProvider.java
+++ b/lib_base/src/main/java/com/android/base/permission/IPermissionUIProvider.java
@@ -2,7 +2,8 @@ package com.android.base.permission;
 
 import android.content.Context;
 import android.content.DialogInterface;
-import android.support.annotation.NonNull;
+
+import androidx.annotation.NonNull;
 
 
 public interface IPermissionUIProvider {
diff --git a/lib_base/src/main/java/com/android/base/permission/PermissionUtils.java b/lib_base/src/main/java/com/android/base/permission/PermissionUtils.java
index aa7e020..43866b4 100644
--- a/lib_base/src/main/java/com/android/base/permission/PermissionUtils.java
+++ b/lib_base/src/main/java/com/android/base/permission/PermissionUtils.java
@@ -1,8 +1,6 @@
 package com.android.base.permission;
 
 import android.content.Context;
-import android.support.annotation.ColorInt;
-import android.support.annotation.NonNull;
 import android.text.SpannableStringBuilder;
 import android.text.Spanned;
 import android.text.style.ForegroundColorSpan;
@@ -13,6 +11,9 @@ import com.blankj.utilcode.util.AppUtils;
 import java.util.Arrays;
 import java.util.List;
 
+import androidx.annotation.ColorInt;
+import androidx.annotation.NonNull;
+
 /**
  * @author Ztiany
  * Email: ztiany3@gmail.com
diff --git a/lib_base/src/main/java/com/android/base/rx/AutoDispose.kt b/lib_base/src/main/java/com/android/base/rx/AutoDispose.kt
index 413afdf..e73c3a7 100644
--- a/lib_base/src/main/java/com/android/base/rx/AutoDispose.kt
+++ b/lib_base/src/main/java/com/android/base/rx/AutoDispose.kt
@@ -2,8 +2,8 @@
 
 package com.android.base.rx
 
-import android.arch.lifecycle.Lifecycle
-import android.arch.lifecycle.LifecycleOwner
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.LifecycleOwner
 import com.uber.autodispose.*
 import com.uber.autodispose.AutoDispose.autoDisposable
 import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider
diff --git a/lib_base/src/main/java/com/android/base/rx/FlowableRetryDelay.java b/lib_base/src/main/java/com/android/base/rx/FlowableRetryDelay.java
index ea96c3e..296da3f 100644
--- a/lib_base/src/main/java/com/android/base/rx/FlowableRetryDelay.java
+++ b/lib_base/src/main/java/com/android/base/rx/FlowableRetryDelay.java
@@ -1,12 +1,12 @@
 package com.android.base.rx;
 
-import android.support.annotation.Nullable;
 
 import org.reactivestreams.Publisher;
 
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
+import androidx.annotation.Nullable;
 import io.reactivex.Flowable;
 import io.reactivex.functions.Function;
 import timber.log.Timber;
@@ -15,8 +15,7 @@ public class FlowableRetryDelay implements Function, Publish
 
     private final int mMaxRetries;
     private final long mRetryDelayMillis;
-    @Nullable
-    private RetryChecker mRetryChecker;
+    @Nullable private RetryChecker mRetryChecker;
     private int mRetryCount = 0;
 
     @SuppressWarnings("unused")
diff --git a/lib_base/src/main/java/com/android/base/rx/ObservableRetryDelay.java b/lib_base/src/main/java/com/android/base/rx/ObservableRetryDelay.java
index 8bdac37..30f1427 100644
--- a/lib_base/src/main/java/com/android/base/rx/ObservableRetryDelay.java
+++ b/lib_base/src/main/java/com/android/base/rx/ObservableRetryDelay.java
@@ -1,10 +1,10 @@
 package com.android.base.rx;
 
-import android.support.annotation.Nullable;
 
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
+import androidx.annotation.Nullable;
 import io.reactivex.Observable;
 import io.reactivex.ObservableSource;
 import io.reactivex.functions.Function;
@@ -14,8 +14,7 @@ public class ObservableRetryDelay implements Function, Obs
 
     private final int mMaxRetries;
     private final long mRetryDelayMillis;
-    @Nullable
-    private RetryChecker mRetryChecker;
+    @Nullable private RetryChecker mRetryChecker;
     private int mRetryCount = 0;
 
     @SuppressWarnings("unused")
diff --git a/lib_base/src/main/java/com/android/base/rx/RxBus.java b/lib_base/src/main/java/com/android/base/rx/RxBus.java
index 663ddb4..9c5489d 100644
--- a/lib_base/src/main/java/com/android/base/rx/RxBus.java
+++ b/lib_base/src/main/java/com/android/base/rx/RxBus.java
@@ -1,9 +1,9 @@
 package com.android.base.rx;
 
-import android.support.annotation.NonNull;
 
 import java.util.UUID;
 
+import androidx.annotation.NonNull;
 import io.reactivex.Flowable;
 import io.reactivex.processors.PublishProcessor;
 
diff --git a/lib_base/src/main/java/com/android/base/utils/android/ActFragWrapper.java b/lib_base/src/main/java/com/android/base/utils/android/ActFragWrapper.java
index 72bce69..27de2e3 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/ActFragWrapper.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/ActFragWrapper.java
@@ -5,9 +5,10 @@ import android.app.Service;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
 
 /**
  * 包含了Activity和Fragment的相关操作
diff --git a/lib_base/src/main/java/com/android/base/utils/android/DevicesUtils.java b/lib_base/src/main/java/com/android/base/utils/android/DevicesUtils.java
index b4e2c26..98a6e99 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/DevicesUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/DevicesUtils.java
@@ -3,7 +3,6 @@ package com.android.base.utils.android;
 import android.Manifest;
 import android.annotation.SuppressLint;
 import android.os.Build;
-import android.support.annotation.RequiresPermission;
 import android.util.Log;
 
 import com.android.base.utils.android.compat.AndroidVersion;
@@ -12,6 +11,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.UUID;
 
+import androidx.annotation.RequiresPermission;
 import timber.log.Timber;
 
 public class DevicesUtils {
diff --git a/lib_base/src/main/java/com/android/base/utils/android/DirectoryUtils.java b/lib_base/src/main/java/com/android/base/utils/android/DirectoryUtils.java
index 8eae586..5d0bc72 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/DirectoryUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/DirectoryUtils.java
@@ -1,12 +1,12 @@
 package com.android.base.utils.android;
 
 import android.os.Environment;
-import android.support.annotation.NonNull;
 
 import com.android.base.utils.BaseUtils;
 
 import java.io.File;
 
+import androidx.annotation.NonNull;
 import timber.log.Timber;
 
 public class DirectoryUtils {
diff --git a/lib_base/src/main/java/com/android/base/utils/android/ResourceUtils.java b/lib_base/src/main/java/com/android/base/utils/android/ResourceUtils.java
index 6e0ce78..c09e07d 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/ResourceUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/ResourceUtils.java
@@ -4,13 +4,14 @@ import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
-import android.support.annotation.ArrayRes;
-import android.support.annotation.AttrRes;
-import android.support.annotation.NonNull;
-import android.support.annotation.StringRes;
 
 import com.android.base.utils.BaseUtils;
 
+import androidx.annotation.ArrayRes;
+import androidx.annotation.AttrRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.StringRes;
+
 
 public class ResourceUtils {
 
diff --git a/lib_base/src/main/java/com/android/base/utils/android/TintUtils.java b/lib_base/src/main/java/com/android/base/utils/android/TintUtils.java
index aeb1a9e..517c131 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/TintUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/TintUtils.java
@@ -7,7 +7,8 @@ import android.graphics.Paint;
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.drawable.Drawable;
-import android.support.v4.graphics.drawable.DrawableCompat;
+
+import androidx.core.graphics.drawable.DrawableCompat;
 
 /**
  * usage:
diff --git a/lib_base/src/main/java/com/android/base/utils/android/VideoUtils.java b/lib_base/src/main/java/com/android/base/utils/android/VideoUtils.java
index acac226..901caff 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/VideoUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/VideoUtils.java
@@ -4,7 +4,8 @@ import android.content.Context;
 import android.graphics.Bitmap;
 import android.media.MediaMetadataRetriever;
 import android.net.Uri;
-import android.support.annotation.WorkerThread;
+
+import androidx.annotation.WorkerThread;
 
 public class VideoUtils {
 
diff --git a/lib_base/src/main/java/com/android/base/utils/android/ViewUtils.java b/lib_base/src/main/java/com/android/base/utils/android/ViewUtils.java
index c5d15e4..568a608 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/ViewUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/ViewUtils.java
@@ -6,14 +6,15 @@ import android.graphics.Canvas;
 import android.graphics.Picture;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
-import android.support.annotation.IdRes;
-import android.support.annotation.Nullable;
-import android.support.v4.app.FragmentActivity;
 import android.view.View;
 import android.view.ViewGroup;
 import android.webkit.WebView;
 import android.widget.TextView;
 
+import androidx.annotation.IdRes;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.FragmentActivity;
+
 public class ViewUtils {
 
     private ViewUtils() {
diff --git a/lib_base/src/main/java/com/android/base/utils/android/WebViewUtils.java b/lib_base/src/main/java/com/android/base/utils/android/WebViewUtils.java
index 984d5d9..e259e0d 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/WebViewUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/WebViewUtils.java
@@ -2,7 +2,6 @@ package com.android.base.utils.android;
 
 import android.content.Context;
 import android.os.Build;
-import android.support.annotation.RequiresApi;
 import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
@@ -10,6 +9,8 @@ import android.webkit.CookieManager;
 import android.webkit.CookieSyncManager;
 import android.webkit.WebView;
 
+import androidx.annotation.RequiresApi;
+
 /**
  * 
  * 关于内存泄漏:最好的方式还是开启独立的进程
diff --git a/lib_base/src/main/java/com/android/base/utils/android/WindowUtils.java b/lib_base/src/main/java/com/android/base/utils/android/WindowUtils.java
index 48f182f..a1f60ea 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/WindowUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/WindowUtils.java
@@ -5,8 +5,6 @@ import android.app.KeyguardManager;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
-import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
 import android.util.DisplayMetrics;
 import android.view.Surface;
 import android.view.View;
@@ -16,6 +14,9 @@ import android.view.WindowManager;
 import com.android.base.utils.BaseUtils;
 import com.android.base.utils.android.compat.SystemBarCompat;
 
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+
 /**
  * 窗口工具箱
  */
diff --git a/lib_base/src/main/java/com/android/base/utils/android/XAppUtils.java b/lib_base/src/main/java/com/android/base/utils/android/XAppUtils.java
index bd3cd0b..7ffc62b 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/XAppUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/XAppUtils.java
@@ -7,10 +7,6 @@ import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.net.Uri;
 import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.RequiresApi;
-import android.support.v4.content.FileProvider;
 import android.webkit.MimeTypeMap;
 
 import com.android.base.utils.common.FileUtils;
@@ -19,6 +15,10 @@ import com.android.base.utils.common.StringChecker;
 import java.io.File;
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.core.content.FileProvider;
 import timber.log.Timber;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java b/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java
index a690091..dec71f0 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/XIntentUtils.java
@@ -9,7 +9,6 @@ import android.net.Uri;
 import android.provider.CalendarContract;
 import android.provider.MediaStore;
 import android.provider.Settings;
-import android.support.annotation.Nullable;
 import android.text.TextUtils;
 import android.util.Log;
 
@@ -18,6 +17,8 @@ import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
 
+import androidx.annotation.Nullable;
+
 import static android.content.ContentValues.TAG;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/utils/android/anim/ActivityAnimUtils.java b/lib_base/src/main/java/com/android/base/utils/android/anim/ActivityAnimUtils.java
index f5fc128..3fbd324 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/anim/ActivityAnimUtils.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/anim/ActivityAnimUtils.java
@@ -3,10 +3,6 @@ package com.android.base.utils.android.anim;
 import android.app.Activity;
 import android.app.ActivityOptions;
 import android.content.Intent;
-import android.support.annotation.AnimRes;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.app.ActivityOptionsCompat;
-import android.support.v7.app.AppCompatActivity;
 import android.transition.Explode;
 import android.transition.Fade;
 import android.transition.Slide;
@@ -15,6 +11,11 @@ import android.view.Window;
 
 import com.android.base.utils.android.compat.AndroidVersion;
 
+import androidx.annotation.AnimRes;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.app.ActivityOptionsCompat;
+
 public class ActivityAnimUtils {
 
     private ActivityAnimUtils() {
diff --git a/lib_base/src/main/java/com/android/base/utils/android/compat/SystemBarCompat.java b/lib_base/src/main/java/com/android/base/utils/android/compat/SystemBarCompat.java
index b63c1d6..81c5528 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/compat/SystemBarCompat.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/compat/SystemBarCompat.java
@@ -8,7 +8,6 @@ import android.content.res.Resources;
 import android.graphics.Color;
 import android.graphics.Point;
 import android.os.Build;
-import android.support.annotation.ColorInt;
 import android.util.DisplayMetrics;
 import android.util.TypedValue;
 import android.view.Display;
@@ -24,6 +23,7 @@ import android.widget.FrameLayout;
 
 import com.android.base.R;
 
+import androidx.annotation.ColorInt;
 import timber.log.Timber;
 
 /**
diff --git a/lib_base/src/main/java/com/android/base/utils/android/text/HtmlBuilder.java b/lib_base/src/main/java/com/android/base/utils/android/text/HtmlBuilder.java
index 0be23a0..2730953 100644
--- a/lib_base/src/main/java/com/android/base/utils/android/text/HtmlBuilder.java
+++ b/lib_base/src/main/java/com/android/base/utils/android/text/HtmlBuilder.java
@@ -17,7 +17,6 @@
 package com.android.base.utils.android.text;
 
 import android.os.Build;
-import android.support.annotation.RequiresApi;
 import android.text.Html;
 import android.text.Spanned;
 import android.widget.TextView;
@@ -25,6 +24,8 @@ import android.widget.TextView;
 import java.util.Iterator;
 import java.util.LinkedList;
 
+import androidx.annotation.RequiresApi;
+
 /**
  * 

Build a valid HTML string for a {@link TextView}.

* diff --git a/lib_base/src/main/java/com/android/base/utils/android/text/RoundedBackgroundSpan.java b/lib_base/src/main/java/com/android/base/utils/android/text/RoundedBackgroundSpan.java index 79856aa..d56bf70 100644 --- a/lib_base/src/main/java/com/android/base/utils/android/text/RoundedBackgroundSpan.java +++ b/lib_base/src/main/java/com/android/base/utils/android/text/RoundedBackgroundSpan.java @@ -3,7 +3,6 @@ package com.android.base.utils.android.text; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.RectF; -import android.support.annotation.NonNull; import android.text.style.ReplacementSpan; /** diff --git a/lib_base/src/main/java/com/android/base/widget/MultiStateView.java b/lib_base/src/main/java/com/android/base/widget/MultiStateView.java index fc1a733..ed25d9b 100644 --- a/lib_base/src/main/java/com/android/base/widget/MultiStateView.java +++ b/lib_base/src/main/java/com/android/base/widget/MultiStateView.java @@ -2,8 +2,6 @@ package com.android.base.widget; import android.content.Context; import android.content.res.TypedArray; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.SparseArray; import android.view.LayoutInflater; @@ -16,6 +14,9 @@ import com.android.base.R; import com.android.base.app.ui.StateLayoutConfig; import com.android.base.app.ui.StateLayoutConfig.ViewState; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import static com.android.base.app.ui.StateLayoutConfig.CONTENT; import static com.android.base.app.ui.StateLayoutConfig.EMPTY; import static com.android.base.app.ui.StateLayoutConfig.ERROR; diff --git a/lib_base/src/main/java/com/android/base/widget/ScrollChildSwipeRefreshLayout.java b/lib_base/src/main/java/com/android/base/widget/ScrollChildSwipeRefreshLayout.java index 8ca7795..1075954 100644 --- a/lib_base/src/main/java/com/android/base/widget/ScrollChildSwipeRefreshLayout.java +++ b/lib_base/src/main/java/com/android/base/widget/ScrollChildSwipeRefreshLayout.java @@ -3,13 +3,14 @@ package com.android.base.widget; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; -import android.support.v4.view.ViewCompat; -import android.support.v4.widget.SwipeRefreshLayout; import android.util.AttributeSet; import android.view.View; import com.android.base.R; +import androidx.core.view.ViewCompat; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + /** * Extends {@link SwipeRefreshLayout} to support non-direct descendant scrolling views. diff --git a/lib_base/src/main/java/com/android/base/widget/SimpleLayout.java b/lib_base/src/main/java/com/android/base/widget/SimpleLayout.java index a6fd29c..f0632ac 100644 --- a/lib_base/src/main/java/com/android/base/widget/SimpleLayout.java +++ b/lib_base/src/main/java/com/android/base/widget/SimpleLayout.java @@ -2,11 +2,12 @@ package com.android.base.widget; import android.content.Context; import android.os.Build; -import android.support.annotation.RequiresApi; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; +import androidx.annotation.RequiresApi; + /** * a SimpleLayout look like FrameLayout */ diff --git a/lib_base/src/main/java/com/android/base/widget/SimpleMultiStateView.java b/lib_base/src/main/java/com/android/base/widget/SimpleMultiStateView.java index 9142b3b..cfbda9e 100644 --- a/lib_base/src/main/java/com/android/base/widget/SimpleMultiStateView.java +++ b/lib_base/src/main/java/com/android/base/widget/SimpleMultiStateView.java @@ -2,7 +2,6 @@ package com.android.base.widget; import android.content.Context; import android.content.res.TypedArray; -import android.support.annotation.NonNull; import android.util.AttributeSet; import android.view.View; @@ -11,6 +10,7 @@ import com.android.base.app.ui.StateLayout; import com.android.base.app.ui.StateLayoutConfig; import com.android.base.utils.common.StringChecker; +import androidx.annotation.NonNull; import timber.log.Timber; import static com.android.base.app.ui.StateLayoutConfig.CONTENT; diff --git a/lib_base/src/main/java/com/android/base/widget/StateActionProcessor.java b/lib_base/src/main/java/com/android/base/widget/StateActionProcessor.java index c1cfe31..241fcc7 100644 --- a/lib_base/src/main/java/com/android/base/widget/StateActionProcessor.java +++ b/lib_base/src/main/java/com/android/base/widget/StateActionProcessor.java @@ -2,9 +2,6 @@ package com.android.base.widget; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import android.support.annotation.DrawableRes; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.view.Gravity; import android.view.View; @@ -17,6 +14,10 @@ import com.android.base.app.ui.CommonId; import com.android.base.app.ui.OnRetryActionListener; import com.android.base.app.ui.StateLayoutConfig; +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; + import static com.android.base.app.ui.StateLayoutConfig.EMPTY; import static com.android.base.app.ui.StateLayoutConfig.ERROR; import static com.android.base.app.ui.StateLayoutConfig.NET_ERROR; diff --git a/lib_base/src/main/java/com/android/base/widget/StateProcessor.java b/lib_base/src/main/java/com/android/base/widget/StateProcessor.java index 7821c8d..60ce9d8 100644 --- a/lib_base/src/main/java/com/android/base/widget/StateProcessor.java +++ b/lib_base/src/main/java/com/android/base/widget/StateProcessor.java @@ -1,11 +1,12 @@ package com.android.base.widget; import android.content.res.TypedArray; -import android.support.annotation.NonNull; import android.view.View; import com.android.base.app.ui.StateLayoutConfig; +import androidx.annotation.NonNull; + /** * @author Ztiany * Email: ztiany3@gmail.com diff --git a/lib_base/src/main/java/com/android/base/widget/pulltozoom/NestedScrollView.java b/lib_base/src/main/java/com/android/base/widget/pulltozoom/NestedScrollView.java index 21dde69..03a12db 100644 --- a/lib_base/src/main/java/com/android/base/widget/pulltozoom/NestedScrollView.java +++ b/lib_base/src/main/java/com/android/base/widget/pulltozoom/NestedScrollView.java @@ -7,21 +7,6 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.support.v4.view.AccessibilityDelegateCompat; -import android.support.v4.view.InputDeviceCompat; -import android.support.v4.view.MotionEventCompat; -import android.support.v4.view.NestedScrollingChild; -import android.support.v4.view.NestedScrollingChildHelper; -import android.support.v4.view.NestedScrollingParent; -import android.support.v4.view.NestedScrollingParentHelper; -import android.support.v4.view.ScrollingView; -import android.support.v4.view.VelocityTrackerCompat; -import android.support.v4.view.ViewCompat; -import android.support.v4.view.accessibility.AccessibilityEventCompat; -import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; -import android.support.v4.view.accessibility.AccessibilityRecordCompat; -import android.support.v4.widget.EdgeEffectCompat; -import android.support.v4.widget.ScrollerCompat; import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; @@ -40,6 +25,22 @@ import android.widget.ScrollView; import java.util.List; +import androidx.core.view.AccessibilityDelegateCompat; +import androidx.core.view.InputDeviceCompat; +import androidx.core.view.MotionEventCompat; +import androidx.core.view.NestedScrollingChild; +import androidx.core.view.NestedScrollingChildHelper; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.NestedScrollingParentHelper; +import androidx.core.view.ScrollingView; +import androidx.core.view.VelocityTrackerCompat; +import androidx.core.view.ViewCompat; +import androidx.core.view.accessibility.AccessibilityEventCompat; +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; +import androidx.core.view.accessibility.AccessibilityRecordCompat; +import androidx.core.widget.EdgeEffectCompat; +import androidx.core.widget.ScrollerCompat; + class NestedScrollView extends FrameLayout implements NestedScrollingParent, NestedScrollingChild, ScrollingView { static final int ANIMATED_SCROLL_GAP = 250; @@ -589,10 +590,10 @@ class NestedScrollView extends FrameLayout implements NestedScrollingParent, Nes */ /* - * Shortcut the most recurring case: the subscribeUser is in the dragging - * state and he is moving his finger. We want to intercept this - * motion. - */ + * Shortcut the most recurring case: the subscribeUser is in the dragging + * state and he is moving his finger. We want to intercept this + * motion. + */ final int action = ev.getAction(); if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) { return true; @@ -606,9 +607,9 @@ class NestedScrollView extends FrameLayout implements NestedScrollingParent, Nes */ /* - * Locally do absolute value. mLastMotionY is set to the y value - * of the down event. - */ + * Locally do absolute value. mLastMotionY is set to the y value + * of the down event. + */ final int activePointerId = mActivePointerId; if (activePointerId == INVALID_POINTER) { // If we don't have a valid id, the touch down wasn't on content. @@ -661,7 +662,7 @@ class NestedScrollView extends FrameLayout implements NestedScrollingParent, Nes * otherwise don't. mScroller.isFinished should be false when * being flinged. We need to call computeScrollOffset() first so that * isFinished() is correct. - */ + */ mScroller.computeScrollOffset(); mIsBeingDragged = !mScroller.isFinished(); startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); @@ -685,9 +686,9 @@ class NestedScrollView extends FrameLayout implements NestedScrollingParent, Nes } /* - * The only time we want to intercept motion events is if we are in the - * drag mode. - */ + * The only time we want to intercept motion events is if we are in the + * drag mode. + */ return mIsBeingDragged; } diff --git a/lib_base/src/main/java/com/android/base/widget/pulltozoom/PullToZoomScrollView.java b/lib_base/src/main/java/com/android/base/widget/pulltozoom/PullToZoomScrollView.java index 02a1dc7..f5bdefc 100644 --- a/lib_base/src/main/java/com/android/base/widget/pulltozoom/PullToZoomScrollView.java +++ b/lib_base/src/main/java/com/android/base/widget/pulltozoom/PullToZoomScrollView.java @@ -13,6 +13,7 @@ import android.view.animation.DecelerateInterpolator; import com.android.base.R; + /** *
  *     {@code
@@ -127,6 +128,7 @@ public class PullToZoomScrollView extends NestedScrollView {
         return mContainerView != null && mZoomView != null;
     }
 
+
     @Override
     protected boolean overScrollByCompat(int deltaX, int deltaY,
                                          int scrollX, int scrollY,
diff --git a/lib_base/src/main/java/com/android/base/widget/ratio/RatioImageView.java b/lib_base/src/main/java/com/android/base/widget/ratio/RatioImageView.java
index 911f0fc..50efd08 100644
--- a/lib_base/src/main/java/com/android/base/widget/ratio/RatioImageView.java
+++ b/lib_base/src/main/java/com/android/base/widget/ratio/RatioImageView.java
@@ -1,9 +1,10 @@
 package com.android.base.widget.ratio;
 
 import android.content.Context;
-import android.support.v7.widget.AppCompatImageView;
 import android.util.AttributeSet;
 
+import androidx.appcompat.widget.AppCompatImageView;
+
 
 public class RatioImageView extends AppCompatImageView {
 
diff --git a/lib_base/src/main/java/com/android/base/widget/ratio/RatioLayout.java b/lib_base/src/main/java/com/android/base/widget/ratio/RatioLayout.java
index 842eef1..7128027 100644
--- a/lib_base/src/main/java/com/android/base/widget/ratio/RatioLayout.java
+++ b/lib_base/src/main/java/com/android/base/widget/ratio/RatioLayout.java
@@ -11,7 +11,7 @@ import com.android.base.R;
 public class RatioLayout extends FrameLayout {
 
     // 宽和高的比例
-    private float ratio = 0.0f;
+    private float ratio;
 
     public RatioLayout(Context context) {
         this(context, null);
diff --git a/lib_base/src/main/java/com/android/base/widget/ratio/RatioTextView.java b/lib_base/src/main/java/com/android/base/widget/ratio/RatioTextView.java
index f1983c9..074a351 100644
--- a/lib_base/src/main/java/com/android/base/widget/ratio/RatioTextView.java
+++ b/lib_base/src/main/java/com/android/base/widget/ratio/RatioTextView.java
@@ -1,9 +1,10 @@
 package com.android.base.widget.ratio;
 
 import android.content.Context;
-import android.support.v7.widget.AppCompatTextView;
 import android.util.AttributeSet;
 
+import androidx.appcompat.widget.AppCompatTextView;
+
 public class RatioTextView extends AppCompatTextView {
 
     private RatioHelper mRatioHelper;
diff --git a/lib_base/src/main/java/com/android/base/widget/recyclerview/DividerItemDecoration.java b/lib_base/src/main/java/com/android/base/widget/recyclerview/DividerItemDecoration.java
index c751d1c..43cdee2 100644
--- a/lib_base/src/main/java/com/android/base/widget/recyclerview/DividerItemDecoration.java
+++ b/lib_base/src/main/java/com/android/base/widget/recyclerview/DividerItemDecoration.java
@@ -6,12 +6,15 @@ import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
-import android.support.annotation.NonNull;
-import android.support.v4.view.ViewCompat;
-import android.support.v7.widget.RecyclerView;
 import android.view.View;
 import android.widget.LinearLayout;
 
+import org.jetbrains.annotations.NotNull;
+
+import androidx.annotation.NonNull;
+import androidx.core.view.ViewCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
 /**
  * 可以指定 SkipDrawStartCount 和 SkipDrawEndCount
  */
@@ -35,7 +38,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
 
     /**
      * Creates a divider {@link RecyclerView.ItemDecoration} that can be used with a
-     * {@link android.support.v7.widget.LinearLayoutManager}.
+     * {@link androidx.recyclerview.widget.LinearLayoutManager}.
      *
      * @param context     Current context, it will be used to access resources.
      * @param orientation Divider orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}.
@@ -84,7 +87,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
     }
 
     @Override
-    public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
+    public void onDraw(@NotNull Canvas c, RecyclerView parent, @NotNull RecyclerView.State state) {
         if (parent.getLayoutManager() == null) {
             return;
         }
diff --git a/lib_base/src/main/java/com/android/base/widget/recyclerview/HidingScrollListener.java b/lib_base/src/main/java/com/android/base/widget/recyclerview/HidingScrollListener.java
index 6561a6c..f55f870 100644
--- a/lib_base/src/main/java/com/android/base/widget/recyclerview/HidingScrollListener.java
+++ b/lib_base/src/main/java/com/android/base/widget/recyclerview/HidingScrollListener.java
@@ -1,7 +1,10 @@
 package com.android.base.widget.recyclerview;
 
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
+
+import org.jetbrains.annotations.NotNull;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
 
 /**
  * RecyclerView滑动时隐藏toolbar
@@ -13,7 +16,7 @@ public abstract class HidingScrollListener extends RecyclerView.OnScrollListener
     private boolean controlsVisible = true;
 
     @Override
-    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+    public void onScrolled(@NotNull RecyclerView recyclerView, int dx, int dy) {
         super.onScrolled(recyclerView, dx, dy);
         int firstVisibleItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition();
         //show views if first item is first visible position and views are hidden
diff --git a/lib_base/src/main/java/com/android/base/widget/recyclerview/MarginDecoration.java b/lib_base/src/main/java/com/android/base/widget/recyclerview/MarginDecoration.java
index b0c4ea8..c586406 100644
--- a/lib_base/src/main/java/com/android/base/widget/recyclerview/MarginDecoration.java
+++ b/lib_base/src/main/java/com/android/base/widget/recyclerview/MarginDecoration.java
@@ -1,10 +1,11 @@
 package com.android.base.widget.recyclerview;
 
 import android.graphics.Rect;
-import android.support.annotation.NonNull;
-import android.support.v7.widget.RecyclerView;
 import android.view.View;
 
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
 
 public class MarginDecoration extends RecyclerView.ItemDecoration {
 
diff --git a/lib_base/src/main/java/com/android/base/widget/recyclerview/OnRecyclerViewScrollBottomListener.java b/lib_base/src/main/java/com/android/base/widget/recyclerview/OnRecyclerViewScrollBottomListener.java
index 0753096..438c0fe 100644
--- a/lib_base/src/main/java/com/android/base/widget/recyclerview/OnRecyclerViewScrollBottomListener.java
+++ b/lib_base/src/main/java/com/android/base/widget/recyclerview/OnRecyclerViewScrollBottomListener.java
@@ -1,9 +1,10 @@
 package com.android.base.widget.recyclerview;
 
-import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.StaggeredGridLayoutManager;
+
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.StaggeredGridLayoutManager;
 
 /**
  * RecyclerView多布局通用滑动底部监听器
diff --git a/lib_base/src/main/java/com/android/base/widget/viewpager/BannerPagerAdapter.java b/lib_base/src/main/java/com/android/base/widget/viewpager/BannerPagerAdapter.java
index dcd8615..7f62763 100644
--- a/lib_base/src/main/java/com/android/base/widget/viewpager/BannerPagerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/widget/viewpager/BannerPagerAdapter.java
@@ -1,9 +1,6 @@
 package com.android.base.widget.viewpager;
 
 import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewCompat;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
@@ -13,6 +10,10 @@ import com.android.base.imageloader.ImageLoaderFactory;
 
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.core.view.ViewCompat;
+import androidx.viewpager.widget.PagerAdapter;
+
 
 class BannerPagerAdapter extends PagerAdapter {
 
diff --git a/lib_base/src/main/java/com/android/base/widget/viewpager/NoScrollViewPager.java b/lib_base/src/main/java/com/android/base/widget/viewpager/NoScrollViewPager.java
index b520c13..247a667 100644
--- a/lib_base/src/main/java/com/android/base/widget/viewpager/NoScrollViewPager.java
+++ b/lib_base/src/main/java/com/android/base/widget/viewpager/NoScrollViewPager.java
@@ -2,12 +2,13 @@ package com.android.base.widget.viewpager;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.view.ViewPager;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.viewpager.widget.ViewPager;
+
 /**
  * @author Ztiany
  * Email: ztiany3@gmail.com
diff --git a/lib_base/src/main/java/com/android/base/widget/viewpager/OptimizeBannerPagerAdapter.java b/lib_base/src/main/java/com/android/base/widget/viewpager/OptimizeBannerPagerAdapter.java
index 5a46a16..f825408 100644
--- a/lib_base/src/main/java/com/android/base/widget/viewpager/OptimizeBannerPagerAdapter.java
+++ b/lib_base/src/main/java/com/android/base/widget/viewpager/OptimizeBannerPagerAdapter.java
@@ -1,10 +1,6 @@
 package com.android.base.widget.viewpager;
 
 import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewCompat;
-import android.support.v7.widget.AppCompatImageView;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
@@ -15,6 +11,11 @@ import com.android.base.imageloader.ImageLoaderFactory;
 import java.util.ArrayList;
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.appcompat.widget.AppCompatImageView;
+import androidx.core.view.ViewCompat;
+import androidx.viewpager.widget.PagerAdapter;
+
 
 class OptimizeBannerPagerAdapter extends PagerAdapter {
 
diff --git a/lib_base/src/main/java/com/android/base/widget/viewpager/PhotoViewPager.java b/lib_base/src/main/java/com/android/base/widget/viewpager/PhotoViewPager.java
index b11a820..3bbcce8 100644
--- a/lib_base/src/main/java/com/android/base/widget/viewpager/PhotoViewPager.java
+++ b/lib_base/src/main/java/com/android/base/widget/viewpager/PhotoViewPager.java
@@ -2,10 +2,10 @@ package com.android.base.widget.viewpager;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
-import android.support.v4.view.ViewPager;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 
+import androidx.viewpager.widget.ViewPager;
 import timber.log.Timber;
 
 public class PhotoViewPager extends ViewPager {
diff --git a/lib_base/src/main/java/com/android/base/widget/viewpager/ZViewPager.java b/lib_base/src/main/java/com/android/base/widget/viewpager/ZViewPager.java
index 30a2859..839ac7f 100644
--- a/lib_base/src/main/java/com/android/base/widget/viewpager/ZViewPager.java
+++ b/lib_base/src/main/java/com/android/base/widget/viewpager/ZViewPager.java
@@ -2,8 +2,6 @@ package com.android.base.widget.viewpager;
 
 import android.content.Context;
 import android.content.res.TypedArray;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewPager;
 import android.util.AttributeSet;
 import android.view.View;
 import android.widget.FrameLayout;
@@ -13,6 +11,9 @@ import com.android.base.R;
 import java.util.ArrayList;
 import java.util.List;
 
+import androidx.viewpager.widget.PagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
 /**
  * 支持无限轮播的 ViewPager
  *
diff --git a/lib_base/src/main/res/layout/base_fragment_list.xml b/lib_base/src/main/res/layout/base_fragment_list.xml
index 347f478..291b220 100644
--- a/lib_base/src/main/res/layout/base_fragment_list.xml
+++ b/lib_base/src/main/res/layout/base_fragment_list.xml
@@ -3,7 +3,7 @@
     style="@style/Base_SimpleMultiStateView"
     xmlns:android="http://schemas.android.com/apk/res/android">
 
-    
diff --git a/lib_base/src/main/res/layout/base_fragment_refresh_list.xml b/lib_base/src/main/res/layout/base_fragment_refresh_list.xml
index 534edcd..85c848c 100644
--- a/lib_base/src/main/res/layout/base_fragment_refresh_list.xml
+++ b/lib_base/src/main/res/layout/base_fragment_refresh_list.xml
@@ -10,7 +10,7 @@
     
 
-        
diff --git a/lib_base/src/main/res/layout/base_layout_empty.xml b/lib_base/src/main/res/layout/base_layout_empty.xml
index b43a2ff..e55c396 100644
--- a/lib_base/src/main/res/layout/base_layout_empty.xml
+++ b/lib_base/src/main/res/layout/base_layout_empty.xml
@@ -1,5 +1,5 @@
 
-
 
-    
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_base/src/main/res/layout/base_layout_error.xml b/lib_base/src/main/res/layout/base_layout_error.xml
index a6c6f7d..72661e3 100644
--- a/lib_base/src/main/res/layout/base_layout_error.xml
+++ b/lib_base/src/main/res/layout/base_layout_error.xml
@@ -1,5 +1,5 @@
 
-
 
-    
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_base/src/main/res/layout/base_layout_loading.xml b/lib_base/src/main/res/layout/base_layout_loading.xml
index 0f60cb5..bb99ade 100644
--- a/lib_base/src/main/res/layout/base_layout_loading.xml
+++ b/lib_base/src/main/res/layout/base_layout_loading.xml
@@ -1,5 +1,5 @@
 
-
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_base/src/main/res/layout/base_layout_no_network.xml b/lib_base/src/main/res/layout/base_layout_no_network.xml
index abffc91..ed3eb6e 100644
--- a/lib_base/src/main/res/layout/base_layout_no_network.xml
+++ b/lib_base/src/main/res/layout/base_layout_no_network.xml
@@ -1,5 +1,5 @@
 
-
 
-    
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_base/src/main/res/layout/base_layout_server_error.xml b/lib_base/src/main/res/layout/base_layout_server_error.xml
index d4e901b..f729628 100644
--- a/lib_base/src/main/res/layout/base_layout_server_error.xml
+++ b/lib_base/src/main/res/layout/base_layout_server_error.xml
@@ -1,5 +1,5 @@
 
-
 
-    
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_base/src/main/res/layout/base_layout_toolbar.xml b/lib_base/src/main/res/layout/base_layout_toolbar.xml
index c4781bc..6d12639 100644
--- a/lib_base/src/main/res/layout/base_layout_toolbar.xml
+++ b/lib_base/src/main/res/layout/base_layout_toolbar.xml
@@ -1,5 +1,5 @@
 
-
 
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib_cache/build.gradle b/lib_cache/build.gradle
index 25af95f..75feab0 100644
--- a/lib_cache/build.gradle
+++ b/lib_cache/build.gradle
@@ -26,7 +26,7 @@ android {
 }
 
 dependencies {
-    implementation androidLibraries.androidAnnotations
+    implementation androidLibraries.annotation
     implementation thirdLibraries.mmkv
     implementation thirdLibraries.gson
     implementation thirdLibraries.supportOptional
diff --git a/lib_media_selector/build.gradle b/lib_media_selector/build.gradle
index aa34461..6e517eb 100644
--- a/lib_media_selector/build.gradle
+++ b/lib_media_selector/build.gradle
@@ -26,8 +26,8 @@ android {
 
 dependencies {
     //support
-    implementation androidLibraries.androidCompatV7
-    implementation androidLibraries.androidDesign
+    implementation androidLibraries.compat
+    implementation androidLibraries.material
 
     /*imageLoader*/
     compileOnly thirdLibraries.glide
diff --git a/lib_network/build.gradle b/lib_network/build.gradle
index 4d8d551..1f29c89 100644
--- a/lib_network/build.gradle
+++ b/lib_network/build.gradle
@@ -33,7 +33,7 @@ android {
 }
 
 dependencies {
-    implementation androidLibraries.androidAnnotations
+    implementation androidLibraries.annotation
     implementation thirdLibraries.supportOptional
     implementation thirdLibraries.timber
     implementation thirdLibraries.retrofit