*******************************/implementation:关于androidx和support库的迁移对比(上:androidx引入,下:support引入) *******************************/\
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:support-v4:28.0.0'
------
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
------
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
------
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
------
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
------
com.airbnb.android:lottie:3.4.2
com.airbnb.android:lottie:2.7.0
---------------------------------------import end-------------------------------------------
*******************************/import:关于androidx和support库的迁移对比(上:androidx 库导入,下:support 库导入) *******************************/
import com.google.android.material.bottomsheet.BottomSheetDialog;
import android.support.design.widget.BottomSheetDialog;
------
import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
------
import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.RecyclerView;
------
import androidx.constraintlayout.widget.Group;
import android.support.constraint.Group;
------
import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.DividerItemDecoration;
------
import androidx.constraintlayout.widget.ConstraintLayout;
import android.support.constraint.ConstraintLayout;
------
import androidx.recyclerview.widget.DefaultItemAnimator;
import android.support.v7.widget.DefaultItemAnimator;
------
import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.GridLayoutManager;
------
import androidx.constraintlayout.widget.ConstraintSet;
import android.support.constraint.ConstraintSet;
------
import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.app.AppCompatActivity;
------
import androidx.annotation.Nullable;
import android.support.annotation.Nullable;
------
import androidx.annotation.ColorRes;
import android.support.annotation.ColorRes;
------
import androidx.annotation.NonNull;
import android.support.annotation.NonNull;
------
import androidx.annotation.ColorInt;
import android.support.annotation.ColorInt;
------
import androidx.annotation.ColorRes;
import android.support.annotation.ColorRes;
------
import androidx.annotation.DrawableRes;
import android.support.annotation.DrawableRes;
------
import androidx.annotation.RequiresApi;
import android.support.annotation.RequiresApi;
------
import androidx.core.os.ParcelableCompat;
import android.support.v4.os.ParcelableCompat;
------
import androidx.core.os.ParcelableCompatCreatorCallbacks;
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
------
import androidx.core.view.AccessibilityDelegateCompat;
import android.support.v4.view.AccessibilityDelegateCompat;
------
import androidx.core.view.MotionEventCompat;
import android.support.v4.view.MotionEventCompat;
------
import androidx.core.view.VelocityTrackerCompat;
import android.support.v4.view.VelocityTrackerCompat;
------
import androidx.core.view.ViewCompat;
import android.support.v4.view.ViewCompat;
------
import androidx.core.view.ViewConfigurationCompat;
import android.support.v4.view.ViewConfigurationCompat;
------
import androidx.core.view.accessibility.AccessibilityEventCompat;
import android.support.v4.view.accessibility.AccessibilityEventCompat;
------
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
------
import androidx.core.view.accessibility.AccessibilityRecordCompat;
import android.support.v4.view.accessibility.AccessibilityRecordCompat;
------
import androidx.core.widget.EdgeEffectCompat;
import android.support.v4.widget.EdgeEffectCompat;
------
import androidx.viewpager.widget.PagerAdapter;
import android.support.v4.view.PagerAdapter;
------
import androidx.viewpager.widget.ViewPager;
import android.support.v4.view.ViewPager;
------
import androidx.fragment.app.Fragment;
import android.support.v4.app.Fragment;
------
import androidx.fragment.app.FragmentTransaction;
import android.support.v4.app.FragmentTransaction;
------
import androidx.multidex.MultiDex;
import android.support.multidex.MultiDex;
------
import androidx.appcompat.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatImageView;
------
import androidx.viewpager.widget.PagerAdapter;
import android.support.v4.view.PagerAdapter;
------
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.support.v4.content.LocalBroadcastManager;
------
import androidx.fragment.app.DialogFragment;
import android.support.v4.app.DialogFragment;
------
import androidx.appcompat.app.AlertDialog;
import android.support.v7.app.AlertDialog;
------
import androidx.core.app.ActivityCompat;
import android.support.v4.app.ActivityCompat;
------
import androidx.core.content.ContextCompat;
import android.support.v4.content.ContextCompat;
------
import androidx.annotation.RawRes;
import android.support.annotation.RawRes;
------
import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentManager;
------
import androidx.fragment.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentPagerAdapter;
------
import com.google.android.material.tabs.TabLayout;
import android.support.design.widget.TabLayout;
------
import androidx.annotation.StringRes;
import android.support.annotation.StringRes;
------
import androidx.appcompat.widget.AppCompatTextView;
import android.support.v7.widget.AppCompatTextView;
------
import androidx.appcompat.widget.Toolbar;
import android.support.v7.widget.Toolbar;
------
import androidx.annotation.IntRange;
import android.support.annotation.IntRange;
------
import androidx.core.content.FileProvider;
import android.support.v4.content.FileProvider;
------
import androidx.appcompat.view.ContextThemeWrapper;
import android.support.v7.view.ContextThemeWrapper;
------
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.support.v4.widget.SwipeRefreshLayout;
------
import com.google.android.gms.common.ConnectionResult;
import com.huawei.hms.api.ConnectionResult;
------
---------------------------------------import end-------------------------------------------
*******************************/xml:关于androidx和support库的迁移对比(上:androidx 使用,下:support 使用) *******************************/
androidx.constraintlayout.widget.ConstraintLayout
android.support.constraint.ConstraintLayout
------
androidx.recyclerview.widget.RecyclerView
android.support.v7.widget.RecyclerView
------
androidx.appcompat.widget.Toolbar
android.support.v7.widget.Toolbar
------
androidx.viewpager.widget.ViewPager
android.support.v4.view.ViewPager
------
androidx.constraintlayout.widget.Toolbar
android.support.v7.widget.Toolbar
------
androidx.constraintlayout.widget.Guideline
android.support.constraint.Guideline
------
androidx.constraintlayout.widget.Group
android.support.constraint.Group
------
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android.support.v4.widget.SwipeRefreshLayout
------
androidx.appcompat.widget.SwitchCompat
android.support.v7.widget.SwitchCompat
------
androidx.appcompat.widget.AppCompatImageButton
android.support.v7.widget.AppCompatImageButton
------
---------------------------------------xml end-------------------------------------------
网友评论