colorize/theme only the progress, don't tint the background for the progress bar

This commit is contained in:
AndyScherzinger 2018-08-28 17:50:02 +02:00
parent 09cd54e201
commit 9560402760
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 20 additions and 3 deletions

View file

@ -305,7 +305,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
mQuotaProgressBar = (ProgressBar) findQuotaViewById(R.id.drawer_quota_ProgressBar);
mQuotaTextPercentage = (TextView) findQuotaViewById(R.id.drawer_quota_percentage);
mQuotaTextLink = (TextView) findQuotaViewById(R.id.drawer_quota_link);
ThemeUtils.colorHorizontalProgressBar(mQuotaProgressBar, ThemeUtils.primaryColor(this));
ThemeUtils.colorProgressBar(mQuotaProgressBar, ThemeUtils.primaryColor(this));
}
/**
@ -818,7 +818,8 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
}
mQuotaProgressBar.setProgress(relative);
ThemeUtils.colorHorizontalProgressBar(mQuotaProgressBar, DisplayUtils.getRelativeInfoColor(this, relative));
ThemeUtils.colorProgressBar(mQuotaProgressBar, DisplayUtils.getRelativeInfoColor(this, relative));
updateQuotaLink();
showQuota(true);

View file

@ -279,7 +279,7 @@ public class ThemeUtils {
}
/**
* sets the coloring of the given progress bar to color_accent.
* sets the coloring of the given progress bar to given color.
*
* @param progressBar the progress bar to be colored
* @param color the color to be used
@ -291,6 +291,22 @@ public class ThemeUtils {
}
}
/**
* sets the coloring of the given progress bar's progress to given color.
*
* @param progressBar the progress bar to be colored
* @param color the color to be used
*/
public static void colorProgressBar(ProgressBar progressBar, @ColorInt int color) {
if (progressBar != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
progressBar.setProgressTintList(ColorStateList.valueOf(color));
} else {
ThemeUtils.colorHorizontalProgressBar(progressBar, color);
}
}
}
/**
* sets the coloring of the given seek bar to color_accent.
*