mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-30 01:21:11 +01:00
Added quota support
This commit is contained in:
@@ -86,6 +86,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
private ImageView ivState;
|
||||
private TextView tvHost;
|
||||
private TextView tvLast;
|
||||
private TextView tvQuota;
|
||||
private TextView tvIdentity;
|
||||
private TextView tvDrafts;
|
||||
private TextView tvWarning;
|
||||
@@ -109,6 +110,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
ivState = itemView.findViewById(R.id.ivState);
|
||||
tvHost = itemView.findViewById(R.id.tvHost);
|
||||
tvLast = itemView.findViewById(R.id.tvLast);
|
||||
tvQuota = itemView.findViewById(R.id.tvQuota);
|
||||
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
||||
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
||||
tvWarning = itemView.findViewById(R.id.tvWarning);
|
||||
@@ -178,6 +180,10 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
" " + account.poll_interval +
|
||||
"/" + account.keep_alive_ok +
|
||||
"/" + account.keep_alive_failed : "")));
|
||||
tvQuota.setText(context.getString(R.string.title_storage_quota,
|
||||
(account.quota_usage == null ? "-" : Helper.humanReadableByteCount(account.quota_usage, true)),
|
||||
(account.quota_limit == null ? "-" : Helper.humanReadableByteCount(account.quota_limit, true))));
|
||||
tvQuota.setVisibility(account.quota_usage != null || account.quota_limit != null ? View.VISIBLE : View.GONE);
|
||||
|
||||
tvIdentity.setVisibility(account.identities > 0 || !settings ? View.GONE : View.VISIBLE);
|
||||
tvDrafts.setVisibility(account.drafts || !settings ? View.GONE : View.VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user