I'm trying to call setProgressDrawable
on a ProgressBar
in my RemoteViews
However there doesn't appear to be a setDrawable(<view_id>,<method>,<value>)
method on RemoveViews
I've tried setBitmap
but setProgressDrawable
takes a Drawable
not a Bitmap
and setInt
doesn't work either.
I wanted to avoid having loads of different widget layout xml files just to handle different color progress bars.
android.widget.RemoteViews. A class that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.
Android ProgressBar is a graphical view indicator that shows some progress. Android progress bar displays a bar representing the completing of the task. Progress bar in android is useful since it gives the user an idea of time to finish its task.
There is no way to do this. My solution was not to create separate layout files, but one that contains all the different ProgressBars with different progressDrawables. In the code you then have to make only one of them visible.
Please note that for older android versions it is not allowed to call setViewVisibility on the Progressbar directly. The trick is to wrap a simple LinearLayout around each bar and to make this wrapper invisible/visible instead. Works fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With