I was wondering if there is any way to set a gradient background color to a Card from the Material Components. I was reading through the docs, but I couldn't find anything.
I was wondering if there is any way to set a gradient background color to a Card from the Material Components. I was reading through the docs, but I couldn't find anything.
Create an xml below res/drawable and set the background of your cardview to this xml.
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/colorPurple"
android:endColor="@color/colorBlue"
android:angle="0"/>
</shape>