So, after reading numerous questions on this, I am still stuck here, here's what I want to do:
- Change the color of the shape (id="myShape") from Java.
- Picking ClipDrawable, and calling setColorFilter(color) does not help.
- Picking GradientDrawable doesn't help either.
There are 3 colors that this progress bar can have. Currently I have made 3 xmls, 1 corresponding to each color, and I load that depending on my condition. I have referred here, but he did not Clip the progress bar, thats the extra thing that I am doing. The problem is, the color values in the xml are dynamic, and I get it from the server, so those three xmls are not of much use, until I can change the color from java. There is a possible solution in level-lists, but I am not very keen in going in that direction, it will be a lot of rework
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/progress_front">
<clip android:clipOrientation="horizontal" >
<shape android:shape="rectangle" android:id="myShape">
<corners
android:bottomLeftRadius="360dp"
android:topLeftRadius="360dp"
android:bottomRightRadius="360dp"
android:topRightRadius="360dp" />
**<solid android:color="@color/bigfoodie_text" />**
</shape>
</clip>
</item>
</layer-list>
Any help is appreciated.