My app\'s minimum API-level is 19 (KitKat), and contains a layout with a horizontal ProgressBar
. I\'m using android:progressTint
attribute to tint
You can wrap with ProgressBar indeterminateDrawable
method for pre-Lollipop
.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Drawable drawableProgress = DrawableCompat.wrap(progressBar.getIndeterminateDrawable());
DrawableCompat.setTint(drawableProgress, ContextCompat.getColor(getContext(), android.R.color.holo_green_light));
progressBar.setIndeterminateDrawable(DrawableCompat.unwrap(drawableProgress));
} else {
progressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(getContext(), android.R.color.holo_green_light), PorterDuff.Mode.SRC_IN);
}