Drawable bottom line

<?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:top=”-6dp” android:left=”-6dp” android:right=”-6dp”> <shape> <solid android:color=”#2b7996″/> <stroke android:color=”#33b5e5″ android:width=”6dp”/> </shape> </item> </layer-list>

Working example – changing drawable background in runtime, dynamically

Here is a short example code how to do it:
I’ve created xml file shape.xml and one method for flexible changing color of shape.

<?xml version=”1.0″ encoding=”utf-8″?>
<shape xmlns:android=”http://schemas.android.com/apk/res/android” >
<solid android:color=”@android:color/holo_blue_bright” />
<corners android:radius=”30dp” />
android:width=”15dp” />

And here is a method for flexible changing color:

Read more