Warning for missing sent messages folder

This commit is contained in:
M66B 2021-07-11 17:26:56 +02:00
parent 72e0514b93
commit d0fa4677a7
5 changed files with 47 additions and 3 deletions

View File

@ -123,6 +123,7 @@ public class FragmentAccount extends FragmentBase {
private ArrayAdapter<EntityFolder> adapter;
private Spinner spDrafts;
private Spinner spSent;
private TextView tvSentWarning;
private Spinner spArchive;
private Spinner spTrash;
private Spinner spJunk;
@ -228,6 +229,7 @@ public class FragmentAccount extends FragmentBase {
spDrafts = view.findViewById(R.id.spDrafts);
spSent = view.findViewById(R.id.spSent);
tvSentWarning = view.findViewById(R.id.tvSentWarning);
spArchive = view.findViewById(R.id.spArchive);
spTrash = view.findViewById(R.id.spTrash);
spJunk = view.findViewById(R.id.spJunk);
@ -482,6 +484,19 @@ public class FragmentAccount extends FragmentBase {
spTrash.setAdapter(adapter);
spJunk.setAdapter(adapter);
tvSentWarning.setVisibility(View.GONE);
spSent.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
tvSentWarning.setVisibility(position == 0 ? View.VISIBLE : View.GONE);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
tvSentWarning.setVisibility(View.VISIBLE);
}
});
adapterSwipe = new ArrayAdapter<EntityFolder>(getContext(), R.layout.spinner_item1, android.R.id.text1, new ArrayList<EntityFolder>()) {
@NonNull
@Override

View File

@ -52,6 +52,7 @@ public class FragmentDialogAccount extends FragmentDialogBase {
final TextView tvInbox = dview.findViewById(R.id.tvInbox);
final TextView tvDrafts = dview.findViewById(R.id.tvDrafts);
final TextView tvSent = dview.findViewById(R.id.tvSent);
final TextView tvSentWarning = dview.findViewById(R.id.tvSentWarning);
final TextView tvTrash = dview.findViewById(R.id.tvTrash);
final TextView tvJunk = dview.findViewById(R.id.tvJunk);
final TextView tvArchive = dview.findViewById(R.id.tvArchive);
@ -76,6 +77,8 @@ public class FragmentDialogAccount extends FragmentDialogBase {
tvLeft.setText(null);
tvRight.setText(null);
tvSentWarning.setVisibility(View.GONE);
Bundle args = getArguments();
final long account = args.getLong("account");
@ -132,6 +135,7 @@ public class FragmentDialogAccount extends FragmentDialogBase {
types.contains(EntityFolder.DRAFTS) ? check : close, null, null, null);
tvSent.setCompoundDrawablesRelative(
types.contains(EntityFolder.SENT) ? check : close, null, null, null);
tvSentWarning.setVisibility(types.contains(EntityFolder.SENT) ? View.GONE : View.VISIBLE);
tvTrash.setCompoundDrawablesRelative(
types.contains(EntityFolder.TRASH) ? check : close, null, null, null);
tvJunk.setCompoundDrawablesRelative(

View File

@ -69,6 +69,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvDrafts" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSentWarning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_setup_quick_no_sent"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSent" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvTrash"
android:layout_width="wrap_content"
@ -80,7 +92,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvSent" />
app:layout_constraintTop_toBottomOf="@+id/tvSentWarning" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvJunk"

View File

@ -792,6 +792,18 @@
app:layout_constraintStart_toEndOf="@id/barrier_folders"
app:layout_constraintTop_toBottomOf="@id/tvDraftsRemark" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSentWarning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_setup_quick_no_sent"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSent" />
<Spinner
android:id="@+id/spArchive"
android:layout_width="0dp"
@ -800,7 +812,7 @@
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/barrier_folders"
app:layout_constraintTop_toBottomOf="@id/spSent" />
app:layout_constraintTop_toBottomOf="@id/tvSentWarning" />
<Spinner
android:id="@+id/spTrash"
@ -1024,7 +1036,7 @@
android:layout_height="0dp"
app:constraint_referenced_ids="
tvDrafts,spDrafts,tvDraftsRemark,
tvSent,spSent,
tvSent,spSent,tvSentWarning,
tvArchive,spArchive,
tvTrash,spTrash,
tvJunk,spJunk,

View File

@ -200,6 +200,7 @@
<string name="title_setup_no_inbox">Inbox not found</string>
<string name="title_setup_advanced_protection">When enrolled in the advanced protection program it is not possible to use a third party email app. This is a restriction imposed by Google.</string>
<string name="title_setup_quick_success">An account has successfully been added</string>
<string name="title_setup_quick_no_sent">Sent messages might not be stored!</string>
<string name="title_setup_quick_configure">To edit the name, color, swipe actions, etc</string>
<string name="title_setup_manage">Manage</string>
<string name="title_setup_grant">Grant</string>