mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-08 10:03:51 +02:00
Added account warning about no identities
This commit is contained in:
@@ -70,6 +70,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
private ImageView ivState;
|
||||
private TextView tvHost;
|
||||
private TextView tvLast;
|
||||
private TextView tvIdentity;
|
||||
private TextView tvDrafts;
|
||||
private TextView tvWarning;
|
||||
private TextView tvError;
|
||||
@@ -88,6 +89,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);
|
||||
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
||||
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
||||
tvWarning = itemView.findViewById(R.id.tvWarning);
|
||||
tvError = itemView.findViewById(R.id.tvError);
|
||||
@@ -139,6 +141,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
tvLast.setText(context.getString(R.string.title_last_connected,
|
||||
account.last_connected == null ? "-" : df.format(account.last_connected)));
|
||||
|
||||
tvIdentity.setVisibility(account.identities > 0 || !settings ? View.GONE : View.VISIBLE);
|
||||
tvDrafts.setVisibility(account.drafts || !settings ? View.GONE : View.VISIBLE);
|
||||
|
||||
tvWarning.setText(account.warning);
|
||||
|
||||
@@ -52,6 +52,10 @@ public interface DaoAccount {
|
||||
" AND folder.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||
" AND NOT ui_seen" +
|
||||
" AND NOT ui_hide) AS unseen" +
|
||||
", (SELECT COUNT(identity.id)" +
|
||||
" FROM identity" +
|
||||
" WHERE identity.account = account.id" +
|
||||
" AND identity.synchronize) AS identities" +
|
||||
", (SELECT COUNT(message.id)" +
|
||||
" FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
|
||||
@@ -23,6 +23,7 @@ public class TupleAccountEx extends EntityAccount {
|
||||
public int unseen;
|
||||
public int unsent;
|
||||
public int operations;
|
||||
public int identities; // synchronizing
|
||||
public boolean drafts;
|
||||
|
||||
public boolean uiEquals(Object obj) {
|
||||
@@ -30,6 +31,7 @@ public class TupleAccountEx extends EntityAccount {
|
||||
TupleAccountEx other = (TupleAccountEx) obj;
|
||||
return (super.equals(obj) &&
|
||||
this.unseen == other.unseen &&
|
||||
this.identities == other.identities &&
|
||||
this.drafts == other.drafts);
|
||||
} else
|
||||
return false;
|
||||
@@ -43,6 +45,7 @@ public class TupleAccountEx extends EntityAccount {
|
||||
this.unseen == other.unseen &&
|
||||
this.unsent == other.unsent &&
|
||||
this.operations == other.operations &&
|
||||
this.identities == other.identities &&
|
||||
this.drafts == other.drafts);
|
||||
} else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user