You can do this by switching to layer-list drawable and drawing your shape on top of the solid color, for example:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <color android:color="@android:color/darker_gray" /> </item> <item> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/darker_gray" /> <stroke android:width="1dip" android:color="@android:color/black"/> <corners android:radius="20dp" /> </shape> </item> </layer-list>
source share