mirror of https://github.com/M66B/FairEmail.git
Sent messages folder / account list
This commit is contained in:
parent
40d5da8fa5
commit
74b7a93ba4
|
@ -104,6 +104,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
private TextView tvMaxSize;
|
||||
private TextView tvIdentity;
|
||||
private TextView tvDrafts;
|
||||
private TextView tvSent;
|
||||
private TextView tvWarning;
|
||||
private TextView tvError;
|
||||
private Button btnHelp;
|
||||
|
@ -133,6 +134,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
tvMaxSize = itemView.findViewById(R.id.tvMaxSize);
|
||||
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
||||
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
||||
tvSent = itemView.findViewById(R.id.tvSent);
|
||||
tvWarning = itemView.findViewById(R.id.tvWarning);
|
||||
tvError = itemView.findViewById(R.id.tvError);
|
||||
btnHelp = itemView.findViewById(R.id.btnHelp);
|
||||
|
@ -233,6 +235,8 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
|
||||
tvIdentity.setVisibility(account.identities > 0 || !settings ? View.GONE : View.VISIBLE);
|
||||
tvDrafts.setVisibility(account.drafts != null || !settings ? View.GONE : View.VISIBLE);
|
||||
tvSent.setVisibility(account.protocol != EntityAccount.TYPE_IMAP ||
|
||||
account.sent != null || !settings ? View.GONE : View.VISIBLE);
|
||||
|
||||
tvWarning.setText(account.warning);
|
||||
tvWarning.setVisibility(account.warning == null || !settings ? View.GONE : View.VISIBLE);
|
||||
|
|
|
@ -66,9 +66,10 @@ public interface DaoAccount {
|
|||
" FROM identity" +
|
||||
" WHERE identity.account = account.id" +
|
||||
" AND identity.synchronize) AS identities" +
|
||||
", drafts.id AS drafts" +
|
||||
", drafts.id AS drafts, sent.id AS sent" +
|
||||
" FROM account" +
|
||||
" LEFT JOIN folder AS drafts ON drafts.account = account.id AND drafts.type = '" + EntityFolder.DRAFTS + "'" +
|
||||
" LEFT JOIN folder AS sent ON sent.account = account.id AND sent.type = '" + EntityFolder.SENT + "'" +
|
||||
" WHERE :all OR account.synchronize" +
|
||||
" GROUP BY account.id" +
|
||||
" ORDER BY CASE WHEN :all THEN 0 ELSE account.`order` END" +
|
||||
|
|
|
@ -25,6 +25,7 @@ public class TupleAccountEx extends EntityAccount {
|
|||
public int unseen;
|
||||
public int identities; // synchronizing
|
||||
public Long drafts;
|
||||
public Long sent;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
@ -33,7 +34,8 @@ public class TupleAccountEx extends EntityAccount {
|
|||
return (super.equals(obj) &&
|
||||
this.unseen == other.unseen &&
|
||||
this.identities == other.identities &&
|
||||
Objects.equals(this.drafts, other.drafts));
|
||||
Objects.equals(this.drafts, other.drafts) &&
|
||||
Objects.equals(this.sent, other.sent));
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -251,6 +251,19 @@
|
|||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvIdentity" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvSent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/title_setup_quick_no_sent"
|
||||
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/tvDrafts" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvWarning"
|
||||
android:layout_width="0dp"
|
||||
|
@ -263,7 +276,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/tvSent" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvError"
|
||||
|
|
Loading…
Reference in New Issue