I have a scenario where i need to have a large number of progress bar drawables. I cant create xml resources for all of them because i want the user to choose a color that will then be used to dynamically create the drawable. Below is one such drawable in xml, how can i create this exact drawable programmatically?
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="@color/transparent" />
<stroke android:width="2px" android:color="@color/category_blue_stroke"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/category_blue" />
<stroke android:width="2px" android:color="@color/category_blue_stroke"/>
</shape>
</clip>
</item>
</layer-list>