My app\'s minimum API-level is 19 (KitKat), and contains a layout with a horizontal ProgressBar
. I\'m using android:progressTint
attribute to tint
Thanks for the suggestions from everyone! :)
The solution which works for me is to create a custom drawable XML file with the
root element. There, I'm defining two layer items with the native Android IDs @android:id/background
and @android:id/progress
. After this, I can define the shapes and color resources I would like to use. This solution is similar to a more popular answer on this SO question.
Content of my res/drawable/progressbar.xml
file:
-
-
Defined as progressDrawable
for my ProgressBar
in the layout XML file:
I didn't have a chance to test it below API 19, but on this level and above it works perfectly.