Show account/identity dimmed when disabled

This commit is contained in:
M66B 2022-01-10 19:41:10 +01:00
parent 4a5d6be29b
commit c6fe5fcaf9
4 changed files with 10 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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" +

View File

@ -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;
}