mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Show backoff time
This commit is contained in:
@@ -96,6 +96,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
private TextView tvHost;
|
||||
private TextView tvLast;
|
||||
private TextView tvUsage;
|
||||
private TextView tvBackoff;
|
||||
private TextView tvQuota;
|
||||
private TextView tvMaxSize;
|
||||
private TextView tvIdentity;
|
||||
@@ -123,6 +124,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
tvHost = itemView.findViewById(R.id.tvHost);
|
||||
tvLast = itemView.findViewById(R.id.tvLast);
|
||||
tvUsage = itemView.findViewById(R.id.tvUsage);
|
||||
tvBackoff = itemView.findViewById(R.id.tvBackoff);
|
||||
tvQuota = itemView.findViewById(R.id.tvQuota);
|
||||
tvMaxSize = itemView.findViewById(R.id.tvMaxSize);
|
||||
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
||||
@@ -197,9 +199,15 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
"/" + account.keep_alive_ok +
|
||||
"/" + account.keep_alive_failed +
|
||||
"/" + account.keep_alive_succeeded : "")));
|
||||
|
||||
tvBackoff.setText(context.getString(R.string.title_backoff_until,
|
||||
account.backoff_until == null ? "-" : DTF.format(account.backoff_until)));
|
||||
tvBackoff.setVisibility(account.backoff_until == null && !BuildConfig.DEBUG ? View.GONE : View.VISIBLE);
|
||||
|
||||
Integer percent = null;
|
||||
if (!settings && account.quota_usage != null && account.quota_limit != null)
|
||||
percent = Math.round((float) account.quota_usage * 100 / account.quota_limit);
|
||||
|
||||
tvUsage.setText(percent == null ? null : NF.format(percent) + "%");
|
||||
tvUsage.setVisibility(percent == null ? View.GONE : View.VISIBLE);
|
||||
tvQuota.setText(context.getString(R.string.title_storage_quota,
|
||||
|
||||
Reference in New Issue
Block a user