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 cfcac6db869..934b0e35152 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,7 +178,7 @@ class ManageAccountsAdapter( } else -> { // Limited storage. Value under 100% - if (userQuota.state == UserQuotaState.CRITICAL) { // Value over 90% + if (userQuota.state == UserQuotaState.CRITICAL || userQuota.state == UserQuotaState.EXCEEDED) { // Value over 90% quotaBar.apply { progressTintList = ColorStateList.valueOf(resources.getColor(R.color.quota_exceeded)) } 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 3074dc0e893..7f68c85f245 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 @@ -370,7 +370,7 @@ abstract class DrawerActivity : ToolbarActivity() { visibility = View.VISIBLE text = getString(R.string.drawer_nearing_quota) } - } else if (userQuota.state == UserQuotaState.CRITICAL) { // Critical storage. Value over 90% + } else if (userQuota.state == UserQuotaState.CRITICAL || userQuota.state == UserQuotaState.EXCEEDED) { // Critical storage. Value over 90% getAccountQuotaBar()?.apply { isVisible = true progress = userQuota.getRelative().toInt() diff --git a/owncloudApp/src/main/java/com/owncloud/android/utils/DisplayUtils.java b/owncloudApp/src/main/java/com/owncloud/android/utils/DisplayUtils.java index 929a8aa7364..1126ecb4505 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/utils/DisplayUtils.java +++ b/owncloudApp/src/main/java/com/owncloud/android/utils/DisplayUtils.java @@ -79,7 +79,7 @@ public class DisplayUtils { * @param bytes Input file size * @return Like something readable like "12 MB" */ - public static String bytesToHumanReadable(long bytes, Context context, boolean includeDecimals) { + public static String bytesToHumanReadable(long bytes, Context context, boolean includeMultipleDecimals) { if (bytes < 0) { return context.getString(R.string.common_pending); @@ -96,8 +96,8 @@ public static String bytesToHumanReadable(long bytes, Context context, boolean i BigDecimal.ROUND_HALF_UP ).stripTrailingZeros(); - if (!includeDecimals) { - readableResult = readableResult.setScale(0, BigDecimal.ROUND_HALF_UP); + if (!includeMultipleDecimals) { + readableResult = readableResult.setScale(1, BigDecimal.ROUND_HALF_UP); } // Unscale only values with ten exponent