mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
24b6da0598
commit
9be5a82e0e
|
@ -202,7 +202,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
tvMaxSize.setVisibility(account.max_size != null && BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
|
||||
tvIdentity.setVisibility(account.identities > 0 || !settings ? View.GONE : View.VISIBLE);
|
||||
tvDrafts.setVisibility(account.drafts || !settings ? View.GONE : View.VISIBLE);
|
||||
tvDrafts.setVisibility(account.drafts != null || !settings ? View.GONE : View.VISIBLE);
|
||||
|
||||
tvWarning.setText(account.warning);
|
||||
tvWarning.setVisibility(account.warning == null || !settings ? View.GONE : View.VISIBLE);
|
||||
|
|
|
@ -63,7 +63,7 @@ public interface DaoAccount {
|
|||
" FROM identity" +
|
||||
" WHERE identity.account = account.id" +
|
||||
" AND identity.synchronize) AS identities" +
|
||||
", CASE WHEN drafts.id IS NULL THEN 0 ELSE 1 END AS drafts" +
|
||||
", drafts.id AS drafts" +
|
||||
" FROM account" +
|
||||
" LEFT JOIN folder AS drafts ON drafts.account = account.id AND drafts.type = '" + EntityFolder.DRAFTS + "'" +
|
||||
" WHERE :all OR account.synchronize" +
|
||||
|
|
|
@ -19,10 +19,12 @@ package eu.faircode.email;
|
|||
Copyright 2018-2020 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class TupleAccountEx extends EntityAccount {
|
||||
public int unseen;
|
||||
public int identities; // synchronizing
|
||||
public boolean drafts;
|
||||
public Long drafts;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
@ -31,7 +33,7 @@ public class TupleAccountEx extends EntityAccount {
|
|||
return (super.equals(obj) &&
|
||||
this.unseen == other.unseen &&
|
||||
this.identities == other.identities &&
|
||||
this.drafts == other.drafts);
|
||||
Objects.equals(this.drafts, other.drafts));
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue