From 571c132770185abd839f8128d7ed6174d72c9f35 Mon Sep 17 00:00:00 2001 From: joragua Date: Thu, 14 Nov 2024 08:50:52 +0100 Subject: [PATCH] feat: added color in the progress bar when the state is critical --- .../android/presentation/accounts/ManageAccountsAdapter.kt | 5 +++++ .../java/com/owncloud/android/ui/activity/DrawerActivity.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsAdapter.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsAdapter.kt index 1397ad8087a..afa24fe13ac 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsAdapter.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsAdapter.kt @@ -178,6 +178,11 @@ class ManageAccountsAdapter( } else -> { // Limited storage. Value under 100% + if (userQuota.state == UserQuotaState.CRITICAL) { + quotaBar.apply { + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.quota_exceeded)) + } + } quotaBar.progress = userQuota.getRelative().toInt() quotaText.text = String.format( context.getString(R.string.manage_accounts_quota), diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.kt index 70975efbdf6..f375657112b 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.kt @@ -374,7 +374,7 @@ abstract class DrawerActivity : ToolbarActivity() { getAccountQuotaBar()?.apply { isVisible = true progress = userQuota.getRelative().toInt() - progressTintList = ColorStateList.valueOf(resources.getColor(R.color.color_accent)) + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.quota_exceeded)) } getAccountQuotaText()?.apply { text = String.format(