I have a drawable that I use as a background in the ProgressBar , i.e. I need the background to be gray and the gradient fill line. It would be ideal if the gradient were not just from light to dark, but light -> dark -> light -> dark, well, i.e. so that the gradients alternate. How can this be implemented?

 <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="5dip" /> <solid android:color="@color/colorBackgroundGrey" /> </shape> </item> <item android:id="@android:id/progress" > <clip> <shape> <corners android:radius="5dip" /> <solid android:color="#E0CFBA" /> </shape> </clip> </item> </layer-list> 

Picture for clarity:

enter image description here

    1 answer 1

    Try this:

     <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:angle="90" android:startColor="#88cacacf" android:centerColor="#88f8f8fd" android:endColor="#88cacacf"/> </shape> 

    Colors specify your own.