HarshitVaish
10/1/2016 - 7:25 AM

Background color gradient. Place bg_gradient.xml in the drawable folder and give it a reference in the background attribute of the view in

Background color gradient. Place bg_gradient.xml in the drawable folder and give it a reference in the background attribute of the view in which you would like to use it in.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="bg_gradient_start">#303F9F</color>
    <color name="bg_gradient_end">#FF4081</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
      android:angle="45"
      android:startColor="@color/bg_gradient_start"
      android:endColor="@color/bg_gradient_end"
      android:type="linear"/>
</shape>