I've seen some topics about handling colors of ProgressBars but none could answer my doubt.
I am using a horizontal ProgressBar
Indeterminate type.
I want it to have a transparent background while having a colored progressBar but cannot find a way to do it.
For a normal ProgressBar (not Indeterminate) I can get a LayerDrawable by calling progressBar.getProgressDrawable()
. Then using findDrawableByLayerId(android.R.id.background)
, I am able to tint just the background.
But using progressBar.getIndeterminateDrawable()
it returns me a GradientDrawable
, so I can't follow the same procedure.
Is it possible to get the colors from a GradientDrawable
for all APIs levels? Cause if it is, I could get the color of the background and change it.
Is there any solution for this?