From 956040276024fb13ecec194b4f6eb65b16e4ce8f Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Tue, 28 Aug 2018 17:50:02 +0200 Subject: [PATCH] colorize/theme only the progress, don't tint the background for the progress bar --- .../android/ui/activity/DrawerActivity.java | 5 +++-- .../com/owncloud/android/utils/ThemeUtils.java | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index d1037537bb..f7edda138b 100644 --- a/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -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); diff --git a/src/main/java/com/owncloud/android/utils/ThemeUtils.java b/src/main/java/com/owncloud/android/utils/ThemeUtils.java index e25e44fb73..52a3c52afb 100644 --- a/src/main/java/com/owncloud/android/utils/ThemeUtils.java +++ b/src/main/java/com/owncloud/android/utils/ThemeUtils.java @@ -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. *