Removed drafts warning from identities

pull/184/head
M66B 4 years ago
parent 9be5a82e0e
commit 1dee158194

@ -80,7 +80,6 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
private TextView tvSignKeyId;
private TextView tvLast;
private TextView tvMaxSize;
private TextView tvDrafts;
private TextView tvError;
private TwoStateOwner powner = new TwoStateOwner(owner, "IdentityPopup");
@ -102,7 +101,6 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
tvSignKeyId = itemView.findViewById(R.id.tvSignKeyId);
tvLast = itemView.findViewById(R.id.tvLast);
tvMaxSize = itemView.findViewById(R.id.tvMaxSize);
tvDrafts = itemView.findViewById(R.id.tvDrafts);
tvError = itemView.findViewById(R.id.tvError);
}
@ -167,8 +165,6 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
tvMaxSize.setText(identity.max_size == null ? null : Helper.humanReadableByteCount(identity.max_size));
tvMaxSize.setVisibility(identity.max_size == null ? View.GONE : View.VISIBLE);
tvDrafts.setVisibility(identity.drafts == null ? View.VISIBLE : View.GONE);
tvError.setText(identity.error);
tvError.setVisibility(identity.error == null ? View.GONE : View.VISIBLE);
}

@ -32,24 +32,21 @@ public interface DaoIdentity {
@Query(TupleIdentityView.query)
LiveData<List<TupleIdentityView>> liveIdentityView();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*, account.name AS accountName" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" LEFT JOIN folder ON folder.account = account.id AND folder.type = '" + EntityFolder.DRAFTS + "'")
" JOIN account ON account.id = identity.account")
LiveData<List<TupleIdentityEx>> liveIdentities();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*, account.name AS accountName" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" AND identity.synchronize" +
" AND account.synchronize")
LiveData<List<TupleIdentityEx>> liveComposableIdentities();
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
@Query("SELECT identity.*, account.name AS accountName" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" WHERE (:account IS NULL OR account.id = :account)" +
" AND identity.synchronize" +
" AND account.synchronize" +

@ -23,15 +23,13 @@ import java.util.Objects;
public class TupleIdentityEx extends EntityIdentity {
public String accountName;
public Long drafts;
@Override
public boolean equals(Object obj) {
if (obj instanceof TupleIdentityEx) {
TupleIdentityEx other = (TupleIdentityEx) obj;
return (super.equals(obj) &&
Objects.equals(accountName, other.accountName) &&
Objects.equals(drafts, other.drafts));
Objects.equals(accountName, other.accountName));
} else
return false;
}

@ -178,19 +178,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvLast" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvDrafts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:text="@string/title_drafts_required"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvLast" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvError"
android:layout_width="0dp"
@ -203,7 +190,7 @@
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tvDrafts" />
app:layout_constraintTop_toBottomOf="@id/tvLast" />
<View
android:id="@+id/marginBottom"

Loading…
Cancel
Save