From 659f2a5829e0bb1fe3115df1a52e3ab471d44d50 Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Mon, 23 May 2022 15:57:57 +0530 Subject: [PATCH] eDrive: allow total or used data to be 0 --- .../java/foundation/e/drive/activity/AccountsActivity.java | 4 ++-- .../main/java/foundation/e/drive/widgets/EDriveWidget.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/foundation/e/drive/activity/AccountsActivity.java b/app/src/main/java/foundation/e/drive/activity/AccountsActivity.java index 85e858d9..dc911d45 100644 --- a/app/src/main/java/foundation/e/drive/activity/AccountsActivity.java +++ b/app/src/main/java/foundation/e/drive/activity/AccountsActivity.java @@ -93,7 +93,7 @@ public class AccountsActivity extends AppCompatActivity { String usedShownQuota = "?"; try { final long totalQuotaLong = Long.parseLong(totalQuota); - if (totalQuotaLong > 0) { + if (totalQuotaLong >= 0) { totalShownQuota = CommonUtils.humanReadableByteCountBin(totalQuotaLong); } } catch (NumberFormatException ignored) { @@ -102,7 +102,7 @@ public class AccountsActivity extends AppCompatActivity { try { final long usedQuotaLong = Long.parseLong(usedQuota); - if (usedQuotaLong > 0) { + if (usedQuotaLong >= 0) { usedShownQuota = CommonUtils.humanReadableByteCountBin(usedQuotaLong); } } catch (NumberFormatException ignore) { diff --git a/app/src/main/java/foundation/e/drive/widgets/EDriveWidget.java b/app/src/main/java/foundation/e/drive/widgets/EDriveWidget.java index 56beb8f2..0041f9ab 100644 --- a/app/src/main/java/foundation/e/drive/widgets/EDriveWidget.java +++ b/app/src/main/java/foundation/e/drive/widgets/EDriveWidget.java @@ -220,7 +220,7 @@ public class EDriveWidget extends AppWidgetProvider { String usedShownQuota = "?"; try { final long totalQuotaLong = Long.parseLong(totalQuota); - if (totalQuotaLong > 0) { + if (totalQuotaLong >= 0) { totalShownQuota = CommonUtils.humanReadableByteCountBin(totalQuotaLong); } } catch (NumberFormatException ignored) { @@ -229,7 +229,7 @@ public class EDriveWidget extends AppWidgetProvider { try { final long usedQuotaLong = Long.parseLong(usedQuota); - if (usedQuotaLong > 0) { + if (usedQuotaLong >= 0) { usedShownQuota = CommonUtils.humanReadableByteCountBin(usedQuotaLong); } } catch (NumberFormatException ignore) { -- GitLab