From e6dd08d0f307a14f8586b37f9609398c5eaecb1e Mon Sep 17 00:00:00 2001 From: joragua Date: Tue, 5 Nov 2024 11:45:58 +0100 Subject: [PATCH] fix: changed the color of progress bar when the quota is not exceeded and hided status text when it isn't necessary --- .../com/owncloud/android/ui/activity/DrawerActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) 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 cf80945761e..64be4671b4d 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 @@ -314,11 +314,13 @@ abstract class DrawerActivity : ToolbarActivity() { getAccountQuotaBar()?.apply { isVisible = true progress = 0 + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.color_accent)) } getAccountQuotaText()?.text = String.format( getString(R.string.drawer_unavailable_free_storage), DisplayUtils.bytesToHumanReadable(userQuota.used, this, true) ) + getAccountQuotaStatusText()?.visibility = View.GONE } else if (userQuota.isExceeded()) { getAccountQuotaBar()?.apply { @@ -343,11 +345,13 @@ abstract class DrawerActivity : ToolbarActivity() { } else if (userQuota.available == 0L) { // Quota 0, guest users getAccountQuotaBar()?.isVisible = false getAccountQuotaText()?.text = getString(R.string.drawer_unavailable_used_storage) + getAccountQuotaStatusText()?.visibility = View.GONE } else if (userQuota.isNearing()) { getAccountQuotaBar()?.apply { isVisible = true progress = userQuota.getRelative().toInt() + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.color_accent)) } getAccountQuotaText()?.apply { text = String.format( @@ -366,6 +370,7 @@ abstract class DrawerActivity : ToolbarActivity() { getAccountQuotaBar()?.apply { isVisible = true progress = userQuota.getRelative().toInt() + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.color_accent)) } getAccountQuotaText()?.apply { text = String.format( @@ -385,6 +390,7 @@ abstract class DrawerActivity : ToolbarActivity() { getAccountQuotaBar()?.apply { progress = userQuota.getRelative().toInt() isVisible = true + progressTintList = ColorStateList.valueOf(resources.getColor(R.color.color_accent)) } getAccountQuotaText()?.text = String.format( getString(R.string.drawer_quota), @@ -392,6 +398,7 @@ abstract class DrawerActivity : ToolbarActivity() { DisplayUtils.bytesToHumanReadable(userQuota.getTotal(), this, true), userQuota.getRelative() ) + getAccountQuotaStatusText()?.visibility = View.GONE } } }