diff --git a/app/build.gradle b/app/build.gradle index 4c371cbb..00d15d0e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { diff --git a/app/src/main/java/com/goldze/mvvmhabit/app/AppViewModelFactory.java b/app/src/main/java/com/goldze/mvvmhabit/app/AppViewModelFactory.java index 01cdf05f..01de8175 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/app/AppViewModelFactory.java +++ b/app/src/main/java/com/goldze/mvvmhabit/app/AppViewModelFactory.java @@ -2,10 +2,11 @@ import android.annotation.SuppressLint; import android.app.Application; -import android.arch.lifecycle.ViewModel; -import android.arch.lifecycle.ViewModelProvider; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; + +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; +import androidx.lifecycle.ViewModel; +import androidx.lifecycle.ViewModelProvider; import com.goldze.mvvmhabit.data.DemoRepository; import com.goldze.mvvmhabit.ui.login.LoginViewModel; diff --git a/app/src/main/java/com/goldze/mvvmhabit/binding/twinklingrefreshlayout/ViewAdapter.java b/app/src/main/java/com/goldze/mvvmhabit/binding/twinklingrefreshlayout/ViewAdapter.java index 1351122c..a23cd1dd 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/binding/twinklingrefreshlayout/ViewAdapter.java +++ b/app/src/main/java/com/goldze/mvvmhabit/binding/twinklingrefreshlayout/ViewAdapter.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.binding.twinklingrefreshlayout; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import com.lcodecore.tkrefreshlayout.RefreshListenerAdapter; import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout; diff --git a/app/src/main/java/com/goldze/mvvmhabit/data/DemoRepository.java b/app/src/main/java/com/goldze/mvvmhabit/data/DemoRepository.java index 98d6970b..239cf3da 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/data/DemoRepository.java +++ b/app/src/main/java/com/goldze/mvvmhabit/data/DemoRepository.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.data; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; import com.goldze.mvvmhabit.data.source.HttpDataSource; import com.goldze.mvvmhabit.data.source.LocalDataSource; diff --git a/app/src/main/java/com/goldze/mvvmhabit/entity/FormEntity.java b/app/src/main/java/com/goldze/mvvmhabit/entity/FormEntity.java index 7ac53432..7e27afd7 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/entity/FormEntity.java +++ b/app/src/main/java/com/goldze/mvvmhabit/entity/FormEntity.java @@ -1,6 +1,6 @@ package com.goldze.mvvmhabit.entity; -import android.databinding.BaseObservable; +import androidx.databinding.BaseObservable; import android.os.Parcel; import android.os.Parcelable; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/base/adapter/BaseFragmentPagerAdapter.java b/app/src/main/java/com/goldze/mvvmhabit/ui/base/adapter/BaseFragmentPagerAdapter.java index 132e074d..5eb09612 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/base/adapter/BaseFragmentPagerAdapter.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/base/adapter/BaseFragmentPagerAdapter.java @@ -1,8 +1,8 @@ package com.goldze.mvvmhabit.ui.base.adapter; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; import java.util.List; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/base/fragment/BasePagerFragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/base/fragment/BasePagerFragment.java index beac1847..ae801d3f 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/base/fragment/BasePagerFragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/base/fragment/BasePagerFragment.java @@ -2,9 +2,8 @@ import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.ViewGroup; @@ -12,6 +11,7 @@ import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.databinding.FragmentBasePagerBinding; import com.goldze.mvvmhabit.ui.base.adapter.BaseFragmentPagerAdapter; +import com.google.android.material.tabs.TabLayout; import java.util.List; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/base/viewmodel/ToolbarViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/base/viewmodel/ToolbarViewModel.java index a9c02f68..fda6b93d 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/base/viewmodel/ToolbarViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/base/viewmodel/ToolbarViewModel.java @@ -1,9 +1,9 @@ package com.goldze.mvvmhabit.ui.base.viewmodel; import android.app.Application; -import android.databinding.ObservableField; -import android.databinding.ObservableInt; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableField; +import androidx.databinding.ObservableInt; +import androidx.annotation.NonNull; import android.view.View; import me.goldze.mvvmhabit.base.BaseModel; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormFragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormFragment.java index 8de8b15d..127b6add 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormFragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormFragment.java @@ -1,11 +1,11 @@ package com.goldze.mvvmhabit.ui.form; import android.app.DatePickerDialog; -import android.arch.lifecycle.Observer; -import android.databinding.Observable; +import androidx.lifecycle.Observer; +import androidx.databinding.Observable; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.DatePicker; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormViewModel.java index 0f22bcaa..799cbdc0 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/form/FormViewModel.java @@ -1,8 +1,8 @@ package com.goldze.mvvmhabit.ui.form; import android.app.Application; -import android.databinding.ObservableBoolean; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableBoolean; +import androidx.annotation.NonNull; import android.text.TextUtils; import android.view.View; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginActivity.java b/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginActivity.java index 79d96bec..a581974c 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginActivity.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginActivity.java @@ -1,9 +1,9 @@ package com.goldze.mvvmhabit.ui.login; -import android.arch.lifecycle.Observer; -import android.arch.lifecycle.ViewModelProviders; +import androidx.lifecycle.Observer; +import androidx.lifecycle.ViewModelProviders; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.text.method.HideReturnsTransformationMethod; import android.text.method.PasswordTransformationMethod; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginViewModel.java index 8b80d2a7..186c2725 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/login/LoginViewModel.java @@ -1,9 +1,9 @@ package com.goldze.mvvmhabit.ui.login; import android.app.Application; -import android.databinding.ObservableField; -import android.databinding.ObservableInt; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableField; +import androidx.databinding.ObservableInt; +import androidx.annotation.NonNull; import android.text.TextUtils; import android.view.View; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoActivity.java b/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoActivity.java index 68dc0dbb..19cbc5d2 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoActivity.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoActivity.java @@ -2,12 +2,11 @@ import android.Manifest; import android.app.ProgressDialog; -import android.arch.lifecycle.Observer; -import android.content.Context; +import androidx.lifecycle.Observer; + import android.content.pm.ActivityInfo; -import android.databinding.Observable; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; @@ -18,7 +17,6 @@ import me.goldze.mvvmhabit.base.BaseActivity; import me.goldze.mvvmhabit.http.DownLoadManager; import me.goldze.mvvmhabit.http.download.ProgressCallBack; -import me.goldze.mvvmhabit.utils.KLog; import me.goldze.mvvmhabit.utils.ToastUtils; import okhttp3.ResponseBody; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoViewModel.java index 8e102bb7..0c5f1f90 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/main/DemoViewModel.java @@ -1,10 +1,8 @@ package com.goldze.mvvmhabit.ui.main; import android.app.Application; -import android.arch.lifecycle.MutableLiveData; -import android.databinding.ObservableBoolean; import android.os.Bundle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.goldze.mvvmhabit.entity.FormEntity; import com.goldze.mvvmhabit.ui.form.FormFragment; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkFragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkFragment.java index f4ec0dd8..174623d7 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkFragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkFragment.java @@ -1,11 +1,11 @@ package com.goldze.mvvmhabit.ui.network; -import android.arch.lifecycle.Observer; -import android.arch.lifecycle.ViewModelProviders; +import androidx.lifecycle.Observer; +import androidx.lifecycle.ViewModelProviders; import android.content.pm.ActivityInfo; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkItemViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkItemViewModel.java index 02928165..359a1089 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkItemViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkItemViewModel.java @@ -1,10 +1,10 @@ package com.goldze.mvvmhabit.ui.network; -import android.databinding.ObservableField; +import androidx.databinding.ObservableField; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import com.goldze.mvvmhabit.R; import com.goldze.mvvmhabit.entity.DemoEntity; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkViewModel.java index d32c9133..50b791a0 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/network/NetWorkViewModel.java @@ -1,9 +1,9 @@ package com.goldze.mvvmhabit.ui.network; import android.app.Application; -import android.databinding.ObservableArrayList; -import android.databinding.ObservableList; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableArrayList; +import androidx.databinding.ObservableList; +import androidx.annotation.NonNull; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/network/detail/DetailViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/network/detail/DetailViewModel.java index 9faf3b22..a7bcb6f8 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/network/detail/DetailViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/network/detail/DetailViewModel.java @@ -1,8 +1,8 @@ package com.goldze.mvvmhabit.ui.network.detail; import android.app.Application; -import android.databinding.ObservableField; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableField; +import androidx.annotation.NonNull; import com.goldze.mvvmhabit.entity.DemoEntity; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleHeadViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleHeadViewModel.java index 72b5b705..f3b72ad2 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleHeadViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleHeadViewModel.java @@ -1,6 +1,6 @@ package com.goldze.mvvmhabit.ui.rv_multi; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import me.goldze.mvvmhabit.base.BaseViewModel; import me.goldze.mvvmhabit.base.MultiItemViewModel; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleLeftItemViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleLeftItemViewModel.java index fb13a855..935d96fe 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleLeftItemViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleLeftItemViewModel.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.rv_multi; -import android.databinding.ObservableField; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableField; +import androidx.annotation.NonNull; import me.goldze.mvvmhabit.base.MultiItemViewModel; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleRightItemViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleRightItemViewModel.java index 4a373f61..2bb8ed8b 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleRightItemViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleRightItemViewModel.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.rv_multi; -import android.databinding.ObservableField; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableField; +import androidx.annotation.NonNull; import me.goldze.mvvmhabit.base.MultiItemViewModel; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewFragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewFragment.java index 09bbc572..9097bac4 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewFragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewFragment.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.rv_multi; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewModel.java index a59bbb3e..fa12ac42 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/rv_multi/MultiRecycleViewModel.java @@ -1,16 +1,15 @@ package com.goldze.mvvmhabit.ui.rv_multi; import android.app.Application; -import android.databinding.ObservableArrayList; -import android.databinding.ObservableList; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableArrayList; +import androidx.databinding.ObservableList; +import androidx.annotation.NonNull; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; import me.goldze.mvvmhabit.base.BaseViewModel; import me.goldze.mvvmhabit.base.MultiItemViewModel; -import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter; import me.tatarka.bindingcollectionadapter2.ItemBinding; import me.tatarka.bindingcollectionadapter2.OnItemBind; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/activity/TabBarActivity.java b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/activity/TabBarActivity.java index 820fe419..6440e6cf 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/activity/TabBarActivity.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/activity/TabBarActivity.java @@ -1,9 +1,8 @@ package com.goldze.mvvmhabit.ui.tab_bar.activity; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.core.content.ContextCompat; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; @@ -16,6 +15,7 @@ import java.util.ArrayList; import java.util.List; +import androidx.fragment.app.FragmentTransaction; import me.goldze.mvvmhabit.base.BaseActivity; import me.goldze.mvvmhabit.base.BaseViewModel; import me.majiajie.pagerbottomtabstrip.NavigationController; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar1Fragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar1Fragment.java index 1d279dda..edf8702c 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar1Fragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar1Fragment.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.tab_bar.fragment; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar2Fragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar2Fragment.java index d94d97a9..93e91de1 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar2Fragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar2Fragment.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.tab_bar.fragment; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar3Fragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar3Fragment.java index 83b44077..0d86be19 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar3Fragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar3Fragment.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.tab_bar.fragment; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar4Fragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar4Fragment.java index e4835eba..c2a9e8c0 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar4Fragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/tab_bar/fragment/TabBar4Fragment.java @@ -1,7 +1,7 @@ package com.goldze.mvvmhabit.ui.tab_bar.fragment; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.ViewGroup; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/activity/ViewPagerActivity.java b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/activity/ViewPagerActivity.java index 3d4d5466..0d304021 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/activity/ViewPagerActivity.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/activity/ViewPagerActivity.java @@ -1,9 +1,9 @@ package com.goldze.mvvmhabit.ui.viewpager.activity; -import android.arch.lifecycle.Observer; +import androidx.lifecycle.Observer; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.TabLayout; +import androidx.annotation.Nullable; +import com.google.android.material.tabs.TabLayout; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/adapter/ViewPagerBindingAdapter.java b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/adapter/ViewPagerBindingAdapter.java index a2b9970c..e0bb7049 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/adapter/ViewPagerBindingAdapter.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/adapter/ViewPagerBindingAdapter.java @@ -1,6 +1,6 @@ package com.goldze.mvvmhabit.ui.viewpager.adapter; -import android.databinding.ViewDataBinding; +import androidx.databinding.ViewDataBinding; import android.view.ViewGroup; import com.goldze.mvvmhabit.databinding.ItemViewpagerBinding; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerItemViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerItemViewModel.java index 1d175ecb..f6210cb4 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerItemViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerItemViewModel.java @@ -1,6 +1,6 @@ package com.goldze.mvvmhabit.ui.viewpager.vm; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import me.goldze.mvvmhabit.base.ItemViewModel; import me.goldze.mvvmhabit.binding.command.BindingAction; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerViewModel.java b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerViewModel.java index 3a50393f..ab1b6748 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerViewModel.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/viewpager/vm/ViewPagerViewModel.java @@ -1,13 +1,12 @@ package com.goldze.mvvmhabit.ui.viewpager.vm; import android.app.Application; -import android.databinding.ObservableArrayList; -import android.databinding.ObservableList; -import android.support.annotation.NonNull; +import androidx.databinding.ObservableArrayList; +import androidx.databinding.ObservableList; +import androidx.annotation.NonNull; import com.goldze.mvvmhabit.BR; import com.goldze.mvvmhabit.R; -import com.goldze.mvvmhabit.ui.viewpager.adapter.ViewPagerBindingAdapter; import me.goldze.mvvmhabit.base.BaseViewModel; import me.goldze.mvvmhabit.binding.command.BindingCommand; diff --git a/app/src/main/java/com/goldze/mvvmhabit/ui/vp_frg/ViewPagerGroupFragment.java b/app/src/main/java/com/goldze/mvvmhabit/ui/vp_frg/ViewPagerGroupFragment.java index bb2783e1..d735823b 100644 --- a/app/src/main/java/com/goldze/mvvmhabit/ui/vp_frg/ViewPagerGroupFragment.java +++ b/app/src/main/java/com/goldze/mvvmhabit/ui/vp_frg/ViewPagerGroupFragment.java @@ -1,6 +1,6 @@ package com.goldze.mvvmhabit.ui.vp_frg; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import com.goldze.mvvmhabit.ui.base.fragment.BasePagerFragment; diff --git a/app/src/main/res/layout/fragment_base_pager.xml b/app/src/main/res/layout/fragment_base_pager.xml index d23670cd..bd9f3fe7 100644 --- a/app/src/main/res/layout/fragment_base_pager.xml +++ b/app/src/main/res/layout/fragment_base_pager.xml @@ -18,7 +18,7 @@ android:background="@color/white" android:orientation="vertical"> - - - - - - - - + diff --git a/build.gradle b/build.gradle index e814da57..e4ba8314 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.0' // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' diff --git a/config.gradle b/config.gradle index 9e2a0209..37feb4f9 100644 --- a/config.gradle +++ b/config.gradle @@ -2,7 +2,7 @@ ext { //android开发版本配置 android = [ compileSdkVersion: 28, - buildToolsVersion: "28.0.0", + buildToolsVersion: "28.0.2", applicationId : "com.goldze.mvvmhabit", minSdkVersion : 15, targetSdkVersion : 28, @@ -11,19 +11,19 @@ ext { ] //version配置 versions = [ - "support-version": "28.0.0", + "support-version": "1.0.0", "junit-version" : "4.12", ] //support配置 support = [ "constraint-layout" : "1.0.0-beta2", - 'support-v4' : "com.android.support:support-v4:${versions["support-version"]}", - 'appcompat-v7' : "com.android.support:appcompat-v7:${versions["support-version"]}", - 'recyclerview-v7' : "com.android.support:recyclerview-v7:${versions["support-version"]}", - 'support-v13' : "com.android.support:support-v13:${versions["support-version"]}", - 'support-fragment' : "com.android.support:support-fragment:${versions["support-version"]}", - 'design' : "com.android.support:design:${versions["support-version"]}", - 'animated-vector-drawable': "com.android.support:animated-vector-drawable:${versions["support-version"]}", + 'support-v4' : "androidx.legacy:legacy-support-v4:${versions["support-version"]}", + 'appcompat-v7' : "androidx.appcompat:appcompat:${versions["support-version"]}", + 'recyclerview-v7' : "androidx.recyclerview:recyclerview:${versions["support-version"]}", + 'support-v13' : "androidx.legacy:legacy-support-v13:${versions["support-version"]}", + 'support-fragment' : "androidx.fragment:fragment:${versions["support-version"]}", + 'design' : "com.google.android.material:material:1.0.0-rc01", + 'animated-vector-drawable': "androidx.vectordrawable:vectordrawable-animated:${versions["support-version"]}", 'junit' : "junit:junit:${versions["junit-version"]}", ] //依赖第三方配置 @@ -55,8 +55,8 @@ ext { "bindingcollectionadapter" : "me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:2.2.0", "bindingcollectionadapter-recyclerview": "me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:2.2.0", //Google AAC - "lifecycle-extensions" : "android.arch.lifecycle:extensions:1.1.1", - "lifecycle-compiler" : "android.arch.lifecycle:compiler:1.1.1", + "lifecycle-extensions" : 'androidx.lifecycle:lifecycle-extensions:2.0.0', + "lifecycle-compiler" : 'androidx.lifecycle:lifecycle-compiler:2.0.0', //MVVMHabit "MVVMHabit" : "com.github.goldze:MVVMHabit:3.1.3", ] diff --git a/gradle.properties b/gradle.properties index f8dd8775..bb2f0f39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,6 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -# android.databinding.enableV2=true \ No newline at end of file +# android.databinding.enableV2=true +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6af21361..a704ba5b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/AppManager.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/AppManager.java index 07f13c41..a0f19797 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/AppManager.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/AppManager.java @@ -1,7 +1,7 @@ package me.goldze.mvvmhabit.base; import android.app.Activity; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import java.util.Stack; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseActivity.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseActivity.java index 012dee9c..e48dae87 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseActivity.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseActivity.java @@ -1,14 +1,14 @@ package me.goldze.mvvmhabit.base; -import android.arch.lifecycle.Observer; -import android.arch.lifecycle.ViewModel; -import android.arch.lifecycle.ViewModelProviders; +import androidx.fragment.app.FragmentActivity; +import androidx.lifecycle.Observer; +import androidx.lifecycle.ViewModel; +import androidx.lifecycle.ViewModelProviders; import android.content.Intent; -import android.databinding.DataBindingUtil; -import android.databinding.ViewDataBinding; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.ViewDataBinding; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentActivity; +import androidx.annotation.Nullable; import com.afollestad.materialdialogs.MaterialDialog; import com.trello.rxlifecycle2.components.support.RxAppCompatActivity; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseApplication.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseApplication.java index b9b12999..a0a2339e 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseApplication.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseApplication.java @@ -3,7 +3,7 @@ import android.app.Activity; import android.app.Application; import android.os.Bundle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import me.goldze.mvvmhabit.utils.Utils; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseFragment.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseFragment.java index cfedd8e9..6b21518e 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseFragment.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseFragment.java @@ -1,14 +1,14 @@ package me.goldze.mvvmhabit.base; -import android.arch.lifecycle.Observer; -import android.arch.lifecycle.ViewModel; -import android.arch.lifecycle.ViewModelProviders; +import androidx.fragment.app.Fragment; +import androidx.lifecycle.Observer; +import androidx.lifecycle.ViewModel; +import androidx.lifecycle.ViewModelProviders; import android.content.Intent; -import android.databinding.DataBindingUtil; -import android.databinding.ViewDataBinding; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.ViewDataBinding; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseViewModel.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseViewModel.java index 4a34cddf..f8a7c852 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseViewModel.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/BaseViewModel.java @@ -1,12 +1,12 @@ package me.goldze.mvvmhabit.base; import android.app.Application; -import android.arch.lifecycle.AndroidViewModel; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.Observer; +import androidx.lifecycle.AndroidViewModel; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.Observer; import android.os.Bundle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.trello.rxlifecycle2.LifecycleProvider; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ContainerActivity.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ContainerActivity.java index 7a136237..631165d2 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ContainerActivity.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ContainerActivity.java @@ -2,23 +2,19 @@ import android.content.Intent; import android.os.Bundle; -import android.os.PersistableBundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.view.View; -import android.view.ViewGroup; + +import androidx.fragment.app.Fragment; + import android.view.WindowManager; -import android.widget.LinearLayout; import com.trello.rxlifecycle2.components.support.RxAppCompatActivity; import java.lang.ref.WeakReference; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; import me.goldze.mvvmhabit.R; -import static android.view.View.generateViewId; - /** * 盛装Fragment的一个容器(代理)Activity diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/IBaseViewModel.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/IBaseViewModel.java index 1f5382ba..9fd73428 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/IBaseViewModel.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/IBaseViewModel.java @@ -1,9 +1,9 @@ package me.goldze.mvvmhabit.base; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleObserver; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.OnLifecycleEvent; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.OnLifecycleEvent; /** * Created by goldze on 2017/6/15. diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ItemViewModel.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ItemViewModel.java index 45ac04e0..d026c3b7 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ItemViewModel.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ItemViewModel.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.base; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * ItemViewModel diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/MultiItemViewModel.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/MultiItemViewModel.java index 0e04d9a3..93f17b36 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/MultiItemViewModel.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/MultiItemViewModel.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.base; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * Create Author:goldze diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ViewModelFactory.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ViewModelFactory.java index 99a04b05..40469607 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ViewModelFactory.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/base/ViewModelFactory.java @@ -2,10 +2,12 @@ import android.annotation.SuppressLint; import android.app.Application; -import android.arch.lifecycle.ViewModel; -import android.arch.lifecycle.ViewModelProvider; -import android.arch.lifecycle.ViewModelProviders; -import android.support.v4.app.FragmentActivity; + +import androidx.fragment.app.FragmentActivity; +import androidx.lifecycle.ViewModel; +import androidx.lifecycle.ViewModelProvider; +import androidx.lifecycle.ViewModelProviders; +//import androidx.fragment.app.FragmentActivity; /** * Created by goldze on 2018/9/30. diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/checkbox/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/checkbox/ViewAdapter.java index 1ffc3add..e0690a8b 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/checkbox/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/checkbox/ViewAdapter.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.binding.viewadapter.checkbox; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/edittext/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/edittext/ViewAdapter.java index 45861741..a164dcfc 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/edittext/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/edittext/ViewAdapter.java @@ -1,7 +1,7 @@ package me.goldze.mvvmhabit.binding.viewadapter.edittext; import android.content.Context; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.text.Editable; import android.text.TextWatcher; import android.view.inputmethod.InputMethodManager; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/image/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/image/ViewAdapter.java index 88202f82..187766a9 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/image/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/image/ViewAdapter.java @@ -1,15 +1,13 @@ package me.goldze.mvvmhabit.binding.viewadapter.image; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.text.TextUtils; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; -import me.goldze.mvvmhabit.R; - /** * Created by goldze on 2017/6/18. */ diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/listview/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/listview/ViewAdapter.java index aea8f0ac..27b68070 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/listview/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/listview/ViewAdapter.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.binding.viewadapter.listview; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.view.View; import android.widget.AbsListView; import android.widget.AdapterView; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/mswitch/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/mswitch/ViewAdapter.java index 577f4adb..20868e47 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/mswitch/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/mswitch/ViewAdapter.java @@ -1,15 +1,12 @@ package me.goldze.mvvmhabit.binding.viewadapter.mswitch; -import android.databinding.BindingAdapter; -import android.text.TextUtils; +import androidx.databinding.BindingAdapter; + import android.widget.CompoundButton; import android.widget.Switch; import me.goldze.mvvmhabit.binding.command.BindingCommand; -import static android.R.attr.checked; -import static me.goldze.mvvmhabit.R.attr.switchState; - /** * Created by goldze on 2017/6/18. */ diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/radiogroup/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/radiogroup/ViewAdapter.java index 9792d8e7..eb14117f 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/radiogroup/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/radiogroup/ViewAdapter.java @@ -1,9 +1,7 @@ package me.goldze.mvvmhabit.binding.viewadapter.radiogroup; -import android.databinding.BindingAdapter; -import android.support.annotation.IdRes; -import android.text.TextUtils; -import android.webkit.WebView; +import androidx.annotation.IdRes; +import androidx.databinding.BindingAdapter; import android.widget.RadioButton; import android.widget.RadioGroup; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/DividerLine.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/DividerLine.java index 894b0f8f..ee0bab56 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/DividerLine.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/DividerLine.java @@ -5,9 +5,10 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; + /** * Created by goldze on 2017/6/16. */ diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/LineManagers.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/LineManagers.java index 5697c68d..a3f65e3d 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/LineManagers.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/LineManagers.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.binding.viewadapter.recyclerview; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; /** * Created by goldze on 2017/6/16. diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/ViewAdapter.java index 50d46ba3..ddbb58eb 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/recyclerview/ViewAdapter.java @@ -1,8 +1,8 @@ package me.goldze.mvvmhabit.binding.viewadapter.recyclerview; -import android.databinding.BindingAdapter; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.databinding.BindingAdapter; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import java.util.concurrent.TimeUnit; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/scrollview/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/scrollview/ViewAdapter.java index 63f6978d..233e57a6 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/scrollview/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/scrollview/ViewAdapter.java @@ -1,7 +1,7 @@ package me.goldze.mvvmhabit.binding.viewadapter.scrollview; -import android.databinding.BindingAdapter; -import android.support.v4.widget.NestedScrollView; +import androidx.databinding.BindingAdapter; +import androidx.core.widget.NestedScrollView; import android.view.ViewTreeObserver; import android.widget.ScrollView; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/spinner/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/spinner/ViewAdapter.java index b1be3ede..a8d1c4c3 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/spinner/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/spinner/ViewAdapter.java @@ -1,12 +1,11 @@ package me.goldze.mvvmhabit.binding.viewadapter.spinner; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.text.TextUtils; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Spinner; -import android.widget.SpinnerAdapter; import java.util.ArrayList; import java.util.List; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/swiperefresh/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/swiperefresh/ViewAdapter.java index 13b6ff80..db8930f5 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/swiperefresh/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/swiperefresh/ViewAdapter.java @@ -1,8 +1,8 @@ package me.goldze.mvvmhabit.binding.viewadapter.swiperefresh; -import android.databinding.BindingAdapter; -import android.support.v4.widget.SwipeRefreshLayout; +import androidx.databinding.BindingAdapter; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import me.goldze.mvvmhabit.binding.command.BindingCommand; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/view/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/view/ViewAdapter.java index 56cc9600..b4f66df8 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/view/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/view/ViewAdapter.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.binding.viewadapter.view; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.view.View; import com.jakewharton.rxbinding2.view.RxView; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/IBindingItemViewModel.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/IBindingItemViewModel.java index 5489b226..f452bc16 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/IBindingItemViewModel.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/IBindingItemViewModel.java @@ -4,7 +4,7 @@ * Created by goldze on 2017/6/15. */ -import android.databinding.ViewDataBinding; +import androidx.databinding.ViewDataBinding; public interface IBindingItemViewModel { void injecDataBinding(V binding); diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/ViewAdapter.java index 32d18833..d80bdd06 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewgroup/ViewAdapter.java @@ -1,16 +1,14 @@ package me.goldze.mvvmhabit.binding.viewadapter.viewgroup; -import android.databinding.BindingAdapter; -import android.databinding.DataBindingUtil; -import android.databinding.ObservableList; -import android.databinding.ViewDataBinding; +import androidx.databinding.BindingAdapter; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.ObservableList; +import androidx.databinding.ViewDataBinding; import android.view.LayoutInflater; import android.view.ViewGroup; import me.tatarka.bindingcollectionadapter2.ItemBinding; -import static me.goldze.mvvmhabit.R.attr.itemView; - /** * Created by goldze on 2017/6/18. */ diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewpager/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewpager/ViewAdapter.java index 2b290317..fd0b4e92 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewpager/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/viewpager/ViewAdapter.java @@ -1,10 +1,8 @@ package me.goldze.mvvmhabit.binding.viewadapter.viewpager; -import android.databinding.BindingAdapter; -import android.support.v4.view.ViewPager; -import android.text.TextUtils; -import android.webkit.WebView; +import androidx.databinding.BindingAdapter; +import androidx.viewpager.widget.ViewPager; import me.goldze.mvvmhabit.binding.command.BindingCommand; /** diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/webview/ViewAdapter.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/webview/ViewAdapter.java index cbabc54d..6eb53cf6 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/webview/ViewAdapter.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/binding/viewadapter/webview/ViewAdapter.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.binding.viewadapter.webview; -import android.databinding.BindingAdapter; +import androidx.databinding.BindingAdapter; import android.text.TextUtils; import android.webkit.WebView; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SingleLiveEvent.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SingleLiveEvent.java index 37c814fd..e524404f 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SingleLiveEvent.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SingleLiveEvent.java @@ -16,15 +16,16 @@ package me.goldze.mvvmhabit.bus.event; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.MutableLiveData; -import android.arch.lifecycle.Observer; -import android.support.annotation.MainThread; -import android.support.annotation.Nullable; import android.util.Log; import java.util.concurrent.atomic.AtomicBoolean; +import androidx.annotation.MainThread; +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 * navigation and Snackbar messages. @@ -41,8 +42,9 @@ public class SingleLiveEvent extends MutableLiveData { private final AtomicBoolean mPending = new AtomicBoolean(false); + @Override @MainThread - public void observe(LifecycleOwner owner, final Observer observer) { + public void observe(LifecycleOwner owner, final Observer observer) { if (hasActiveObservers()) { Log.w(TAG, "Multiple observers registered but only one will be notified of changes."); @@ -59,6 +61,7 @@ public void onChanged(@Nullable T t) { }); } + @Override @MainThread public void setValue(@Nullable T t) { mPending.set(true); diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SnackbarMessage.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SnackbarMessage.java index 66a1df82..dd2b9752 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SnackbarMessage.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/bus/event/SnackbarMessage.java @@ -16,10 +16,10 @@ package me.goldze.mvvmhabit.bus.event; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.Observer; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.Observer; /** * A SingleLiveEvent used for Snackbar messages. Like a {@link SingleLiveEvent} but also prevents diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocConfig.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocConfig.java index 5175bab4..e17339c0 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocConfig.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocConfig.java @@ -17,10 +17,10 @@ package me.goldze.mvvmhabit.crash; import android.app.Activity; -import android.support.annotation.DrawableRes; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.DrawableRes; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import java.io.Serializable; import java.lang.annotation.Retention; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocInitProvider.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocInitProvider.java index b0cd50e5..a6cdfbb7 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocInitProvider.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CaocInitProvider.java @@ -20,8 +20,8 @@ import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; public class CaocInitProvider extends ContentProvider { diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CustomActivityOnCrash.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CustomActivityOnCrash.java index c8dfb4d2..c8f46f55 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CustomActivityOnCrash.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/CustomActivityOnCrash.java @@ -27,9 +27,9 @@ import android.content.pm.ResolveInfo; import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RestrictTo; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RestrictTo; import android.util.Log; import java.io.PrintWriter; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/DefaultErrorActivity.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/DefaultErrorActivity.java index 1fbd7a56..e1980913 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/DefaultErrorActivity.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/crash/DefaultErrorActivity.java @@ -23,9 +23,9 @@ import android.content.DialogInterface; import android.content.res.TypedArray; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.content.res.ResourcesCompat; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; +import androidx.core.content.res.ResourcesCompat; +import androidx.appcompat.app.AppCompatActivity; import android.util.TypedValue; import android.view.View; import android.widget.Button; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/DownLoadManager.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/DownLoadManager.java index 6ab886bb..5a856f3a 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/DownLoadManager.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/DownLoadManager.java @@ -1,19 +1,14 @@ package me.goldze.mvvmhabit.http; -import android.databinding.ObservableBoolean; - import java.util.concurrent.TimeUnit; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.functions.Consumer; -import io.reactivex.observers.DisposableObserver; import io.reactivex.schedulers.Schedulers; -import me.goldze.mvvmhabit.bus.RxBus; import me.goldze.mvvmhabit.http.download.DownLoadSubscriber; import me.goldze.mvvmhabit.http.download.ProgressCallBack; import me.goldze.mvvmhabit.http.interceptor.ProgressInterceptor; -import me.goldze.mvvmhabit.utils.RxUtils; import okhttp3.OkHttpClient; import okhttp3.ResponseBody; import retrofit2.Retrofit; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/MaterialDialogUtils.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/MaterialDialogUtils.java index c3ab2dda..7bb33746 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/MaterialDialogUtils.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/MaterialDialogUtils.java @@ -3,7 +3,7 @@ import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.text.InputType; import android.text.TextUtils; import android.util.TypedValue; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/RxUtils.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/RxUtils.java index 30e5528b..19423b8b 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/RxUtils.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/RxUtils.java @@ -1,11 +1,11 @@ package me.goldze.mvvmhabit.utils; import android.content.Context; -import android.support.v4.app.Fragment; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; +import androidx.fragment.app.Fragment; import io.reactivex.Observable; import io.reactivex.ObservableSource; import io.reactivex.ObservableTransformer; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/SPUtils.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/SPUtils.java index 2a88acf0..b3c51d24 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/SPUtils.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/SPUtils.java @@ -2,7 +2,7 @@ import android.content.Context; import android.content.SharedPreferences; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Collections; import java.util.HashMap; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/ToastUtils.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/ToastUtils.java index a7097d5b..e28f3e90 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/ToastUtils.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/ToastUtils.java @@ -2,11 +2,11 @@ import android.content.Context; import android.os.Handler; import android.os.Looper; -import android.support.annotation.ColorInt; -import android.support.annotation.DrawableRes; -import android.support.annotation.LayoutRes; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; +import androidx.annotation.ColorInt; +import androidx.annotation.DrawableRes; +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java index affc9ecc..1d378080 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java @@ -2,7 +2,7 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * Created by goldze on 2017/5/14. diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Luban.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Luban.java index a3d45487..da9c423f 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Luban.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Luban.java @@ -5,7 +5,7 @@ import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.media.ExifInterface; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.text.TextUtils; import android.util.Log; diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Preconditions.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Preconditions.java index ffec2c26..590dfde0 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Preconditions.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/compression/Preconditions.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.utils.compression; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; final class Preconditions { diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/MemoryConstants.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/MemoryConstants.java index 699e0370..639efd6d 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/MemoryConstants.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/MemoryConstants.java @@ -1,10 +1,10 @@ package me.goldze.mvvmhabit.utils.constant; -import android.support.annotation.IntDef; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + /** * Created by goldze on 2017/5/14. * 存储相关常量 diff --git a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/TimeConstants.java b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/TimeConstants.java index 669cb180..a6f8ce58 100644 --- a/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/TimeConstants.java +++ b/mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/constant/TimeConstants.java @@ -1,6 +1,6 @@ package me.goldze.mvvmhabit.utils.constant; -import android.support.annotation.IntDef; +import androidx.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy;