How to add cardview in layout xml in AndroidX
After upgraded to AndroidX
You have 2 different options:
Just add:
implementation 'com.google.android.material:material:1.2.0'
and in your xml you can use:
Just add:
implementation 'androidx.cardview:cardview:1.0.0'
and in your xml you can use:
They are different:
MaterialCardView extends androidx.cardview.widget.CardView and provides all of the features of CardView and
MaterialComponents theme by default (it uses by deafult the style Widget.MaterialComponents.CardView)ShapeAppearanceModel