
Just by wrapping your layout in CardView makes your list look much better. You can set the properties such as app:cardElevation, app:cardBackgroundcolor etc.
You don't need to add any extra line in your Java/Kotlin file. But in your xml file for the list row (not the main xml file), you can add something like this
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardViewxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="10dp"
android:descendantFocusability="blocksDescendants"
app:cardElevation="4dp"
android:layout_margin="8dp"
app:cardBackgroundColor="@color/cyan700">
<!----your actual content ></androidx.cardview.widget.CardView>
That's it. Your list looks all fancy
Comments
Post a Comment