W would like to have a drawable
which has background and gradient on the left that is about 10dp
wide.
Image of what I would like to achieve:
- Red gradient on the left
- Background on the rest
How I can achieve that?
I've tried layer-list
with two shapes but with no luck.
Item background:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/background" />
<item android:drawable="@drawable/gradient" />
</layer-list>
Background drawable:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/black" />
</shape>
Shape drawable:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF"
android:angle="90"/>
<size android:width="10dp" />
</shape>