I have to set background of this to many views with different colors. but if I make it so, the xml will be around 20 files, which is huge, so I want to convert the following xml layer-list
into progmatical way into fully independent module without even a single xml, so that it can be reusable, please help me guys.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
//i can create this drawable
<item>
<shape android:shape="rectangle">
<solid android:color="#ff2632"/>
</shape> </item>
//I don't know how to achieve this one, especially this "bottom property"
<item android:bottom="2dp">
<shape android:shape="rectangle">
<solid android:color="#d7ffa2"/>
</shape> </item>
</layer-list>