mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Show account/identity dimmed when disabled
This commit is contained in:
parent
4a5d6be29b
commit
c6fe5fcaf9
4 changed files with 10 additions and 6 deletions
|
@ -190,6 +190,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
|
||||
private void bindTo(TupleAccountEx account) {
|
||||
view.setActivated(account.tbd != null);
|
||||
view.setAlpha(account.synchronize ? 1.0f : Helper.LOW_LIGHT);
|
||||
vwColor.setBackgroundColor(account.color == null ? Color.TRANSPARENT : account.color);
|
||||
vwColor.setVisibility(ActivityBilling.isPro(context) ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
|
|||
}
|
||||
|
||||
private void bindTo(TupleIdentityEx identity) {
|
||||
view.setAlpha(identity.synchronize && identity.accountSynchronize ? 1.0f : Helper.LOW_LIGHT);
|
||||
vwColor.setBackgroundColor(identity.color == null ? Color.TRANSPARENT : identity.color);
|
||||
vwColor.setVisibility(ActivityBilling.isPro(context) ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface DaoIdentity {
|
|||
LiveData<List<TupleIdentityView>> liveIdentityView();
|
||||
|
||||
@Query("SELECT identity.*" +
|
||||
", account.name AS accountName, account.category AS accountCategory" +
|
||||
", account.name AS accountName, account.category AS accountCategory, account.synchronize AS accountSynchronize" +
|
||||
", folder.id AS drafts" +
|
||||
" FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
|
@ -41,7 +41,7 @@ public interface DaoIdentity {
|
|||
LiveData<List<TupleIdentityEx>> liveIdentities();
|
||||
|
||||
@Query("SELECT identity.*" +
|
||||
", account.name AS accountName, account.category AS accountCategory" +
|
||||
", account.name AS accountName, account.category AS accountCategory, account.synchronize AS accountSynchronize" +
|
||||
", folder.id AS drafts" +
|
||||
" FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
|
@ -51,7 +51,7 @@ public interface DaoIdentity {
|
|||
LiveData<List<TupleIdentityEx>> liveComposableIdentities();
|
||||
|
||||
@Query("SELECT identity.*" +
|
||||
", account.name AS accountName, account.category AS accountCategory" +
|
||||
", account.name AS accountName, account.category AS accountCategory, account.synchronize AS accountSynchronize" +
|
||||
", folder.id AS drafts" +
|
||||
" FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Objects;
|
|||
public class TupleIdentityEx extends EntityIdentity {
|
||||
public String accountName;
|
||||
public String accountCategory;
|
||||
public boolean accountSynchronize;
|
||||
public Long drafts;
|
||||
|
||||
@Override
|
||||
|
@ -31,9 +32,10 @@ public class TupleIdentityEx extends EntityIdentity {
|
|||
if (obj instanceof TupleIdentityEx) {
|
||||
TupleIdentityEx other = (TupleIdentityEx) obj;
|
||||
return (super.equals(obj) &&
|
||||
Objects.equals(accountCategory, other.accountCategory) &&
|
||||
Objects.equals(accountName, other.accountName) &&
|
||||
Objects.equals(drafts, other.drafts));
|
||||
Objects.equals(this.accountCategory, other.accountCategory) &&
|
||||
Objects.equals(this.accountName, other.accountName) &&
|
||||
this.accountSynchronize == other.accountSynchronize &&
|
||||
Objects.equals(this.drafts, other.drafts));
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue