List of usage examples for android.widget ProgressBar getResources
public Resources getResources()
From source file:com.synox.android.utils.DisplayUtils.java
/** * sets the coloring of the given progress bar to color_accent. * * @param progressBar the progress bar to be colored */// w ww. j a va 2 s . c o m public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) { if (progressBar != null && Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) { int color = progressBar.getResources().getColor(R.color.accent); progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); progressBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); } }
From source file:com.cerema.cloud2.utils.DisplayUtils.java
/** * sets the coloring of the given progress bar to color_accent. * * @param progressBar the progress bar to be colored *//* ww w. j a v a2 s .c om*/ public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) { if (progressBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { int color = progressBar.getResources().getColor(R.color.color_accent); progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); progressBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN); } }