Search code examples
androidcolorsprogress-barscale

Android : Scale and change color Of Draw-able progress bar simultaneously


I am a newbie to Android app development. In my application, I am declaring a progress bar using "ProgressBar myProgressBar". When I get "myProgressBar.getMax()", I am animating the entire drawable to scale and fit the screens layout using the following XML

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="1" android:toXScale="5.0" android:fromYScale="1"
android:toYScale="6.0" android:pivotX="50%" android:pivotY="50%"
android:duration="5000" />

And am doing a "load animation (getApplicationContext(), R.anim.progressbarscale);" to scale the progressbar.

My question is, while the scaling animation is in progress, can I dynamically change the fill color of the progressbar? Can I pause the animation, change color and resume the animation?

I hope I am clear with my question. Please help.


Solution

  • This is not possible with the standard widget, but it is however possible to build your own widget with properties that are normally not possible.