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 tvMaxSize;
|
||||||
private TextView tvIdentity;
|
private TextView tvIdentity;
|
||||||
private TextView tvDrafts;
|
private TextView tvDrafts;
|
||||||
|
private TextView tvSent;
|
||||||
private TextView tvWarning;
|
private TextView tvWarning;
|
||||||
private TextView tvError;
|
private TextView tvError;
|
||||||
private Button btnHelp;
|
private Button btnHelp;
|
||||||
|
@ -133,6 +134,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||||
tvMaxSize = itemView.findViewById(R.id.tvMaxSize);
|
tvMaxSize = itemView.findViewById(R.id.tvMaxSize);
|
||||||
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
tvIdentity = itemView.findViewById(R.id.tvIdentity);
|
||||||
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
||||||
|
tvSent = itemView.findViewById(R.id.tvSent);
|
||||||
tvWarning = itemView.findViewById(R.id.tvWarning);
|
tvWarning = itemView.findViewById(R.id.tvWarning);
|
||||||
tvError = itemView.findViewById(R.id.tvError);
|
tvError = itemView.findViewById(R.id.tvError);
|
||||||
btnHelp = itemView.findViewById(R.id.btnHelp);
|
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);
|
tvIdentity.setVisibility(account.identities > 0 || !settings ? View.GONE : View.VISIBLE);
|
||||||
tvDrafts.setVisibility(account.drafts != null || !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.setText(account.warning);
|
||||||
tvWarning.setVisibility(account.warning == null || !settings ? View.GONE : View.VISIBLE);
|
tvWarning.setVisibility(account.warning == null || !settings ? View.GONE : View.VISIBLE);
|
||||||
|
|
|
@ -66,9 +66,10 @@ public interface DaoAccount {
|
||||||
" FROM identity" +
|
" FROM identity" +
|
||||||
" WHERE identity.account = account.id" +
|
" WHERE identity.account = account.id" +
|
||||||
" AND identity.synchronize) AS identities" +
|
" AND identity.synchronize) AS identities" +
|
||||||
", drafts.id AS drafts" +
|
", drafts.id AS drafts, sent.id AS sent" +
|
||||||
" FROM account" +
|
" FROM account" +
|
||||||
" LEFT JOIN folder AS drafts ON drafts.account = account.id AND drafts.type = '" + EntityFolder.DRAFTS + "'" +
|
" 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" +
|
" WHERE :all OR account.synchronize" +
|
||||||
" GROUP BY account.id" +
|
" GROUP BY account.id" +
|
||||||
" ORDER BY CASE WHEN :all THEN 0 ELSE account.`order` END" +
|
" 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 unseen;
|
||||||
public int identities; // synchronizing
|
public int identities; // synchronizing
|
||||||
public Long drafts;
|
public Long drafts;
|
||||||
|
public Long sent;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
|
@ -33,7 +34,8 @@ public class TupleAccountEx extends EntityAccount {
|
||||||
return (super.equals(obj) &&
|
return (super.equals(obj) &&
|
||||||
this.unseen == other.unseen &&
|
this.unseen == other.unseen &&
|
||||||
this.identities == other.identities &&
|
this.identities == other.identities &&
|
||||||
Objects.equals(this.drafts, other.drafts));
|
Objects.equals(this.drafts, other.drafts) &&
|
||||||
|
Objects.equals(this.sent, other.sent));
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,19 @@
|
||||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvIdentity" />
|
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
|
<eu.faircode.email.FixedTextView
|
||||||
android:id="@+id/tvWarning"
|
android:id="@+id/tvWarning"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -263,7 +276,7 @@
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/vwColor"
|
app:layout_constraintStart_toEndOf="@id/vwColor"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvDrafts" />
|
app:layout_constraintTop_toBottomOf="@id/tvSent" />
|
||||||
|
|
||||||
<eu.faircode.email.FixedTextView
|
<eu.faircode.email.FixedTextView
|
||||||
android:id="@+id/tvError"
|
android:id="@+id/tvError"
|
||||||
|
|
Loading…
Reference in New Issue