I have a progressBar using the ProgressBar class.
Just doing this:
progressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizont
I have given default color in xml by drawable.
I have changed it programatically.
activity_splasg.xml:
splash_progress_drawable.xml:
-
-
Now How to change ProgressDrawable color programatically.
ProgressBar splashProgressBar = (ProgressBar)findViewById(R.id.splashProgressBar);
Drawable bgDrawable = splashProgressBar.getProgressDrawable();
bgDrawable.setColorFilter(Color.BLUE, android.graphics.PorterDuff.Mode.MULTIPLY);
splashProgressBar.setProgressDrawable(bgDrawable);
Hope this will help you.