I need to set secondary progress bar color programmatically.
I only see the method
ProgressBar.setProgressDrawable(drawable)
for set the primary color, but there isn't a method for set the secondary color.
How I can do it?
I need to set secondary progress bar color programmatically.
I only see the method
ProgressBar.setProgressDrawable(drawable)
for set the primary color, but there isn't a method for set the secondary color.
How I can do it?
Probably not relevant to Michele, but perhaps it will help someone else..
ProgressBar.getProgressDrawable()
returns aLayerDrawable
in which:I try to modify the colors whit (example):
but sometimes the screen freeze, sometimes crash. Finally I abandoned the search for lack of time. Sorry :(
Michele
The drawable you specify using
setProgressDrawable
has background, primary and secondary drawables in it. Here is an example ofProgressBar
drawable that is shipped with android:Check this
You can use a drawable xml like this to set progressdrawable
Refer this link
https://stackoverflow.com/a/27144594/1554031