Added archive auto delete hint

pull/197/head
M66B 3 years ago
parent 9736e58b29
commit 9498813e73

@ -76,6 +76,7 @@ public class FragmentFolder extends FragmentBase {
private EditText etKeepDays;
private CheckBox cbKeepAll;
private CheckBox cbAutoDelete;
private TextView tvAutoDeleteArchiveHint;
private Button btnSave;
private ContentLoadingProgressBar pbSave;
private TextView tvInboxRootHint;
@ -140,6 +141,7 @@ public class FragmentFolder extends FragmentBase {
etKeepDays = view.findViewById(R.id.etKeepDays);
cbKeepAll = view.findViewById(R.id.cbKeepAll);
cbAutoDelete = view.findViewById(R.id.cbAutoDelete);
tvAutoDeleteArchiveHint = view.findViewById(R.id.tvAutoDeleteArchiveHint);
btnSave = view.findViewById(R.id.btnSave);
pbSave = view.findViewById(R.id.pbSave);
tvInboxRootHint = view.findViewById(R.id.tvInboxRootHint);
@ -245,6 +247,7 @@ public class FragmentFolder extends FragmentBase {
cbAutoClassifySource.setVisibility(View.GONE);
cbAutoClassifyTarget.setVisibility(View.GONE);
tvAutoClassifyPro.setVisibility(View.GONE);
tvAutoDeleteArchiveHint.setVisibility(View.GONE);
grpAutoDelete.setVisibility(View.GONE);
btnSave.setEnabled(false);
pbSave.setVisibility(View.GONE);
@ -322,6 +325,8 @@ public class FragmentFolder extends FragmentBase {
Helper.setViewsEnabled(view, true);
boolean canAutoClassify = (imap && MessageClassifier.isEnabled(getContext()));
boolean canAutoDelete = (imap && (folder == null || !folder.read_only));
boolean isArchive = (folder != null && EntityFolder.ARCHIVE.equals(folder.type));
boolean pro = (ActivityBilling.isPro(getContext()) ||
(folder != null && EntityFolder.JUNK.equals(folder.type)));
@ -340,7 +345,8 @@ public class FragmentFolder extends FragmentBase {
cbAutoDelete.setEnabled(!cbKeepAll.isChecked());
cbAutoDelete.setText(folder != null && EntityFolder.TRASH.equals(folder.type)
? R.string.title_auto_delete : R.string.title_auto_trash);
grpAutoDelete.setVisibility(!imap || (folder != null && folder.read_only) ? View.GONE : View.VISIBLE);
grpAutoDelete.setVisibility(canAutoDelete ? View.VISIBLE : View.GONE);
tvAutoDeleteArchiveHint.setVisibility(canAutoDelete && isArchive ? View.VISIBLE : View.GONE);
btnSave.setEnabled(true);
tvInboxRootHint.setVisibility(folder == null && parent == null ? View.VISIBLE : View.GONE);

@ -346,6 +346,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbAutoDelete" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvAutoDeleteArchiveHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/title_auto_delete_archive_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAutoDeleteHint" />
<Button
android:id="@+id/btnSave"
android:layout_width="wrap_content"
@ -354,7 +365,7 @@
android:tag="disable"
android:text="@string/title_save"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAutoDeleteHint" />
app:layout_constraintTop_toBottomOf="@id/tvAutoDeleteArchiveHint" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbSave"

@ -826,6 +826,7 @@
<string name="title_auto_trash">Automatically move old messages to trash</string>
<string name="title_auto_delete">Automatically permanently delete old messages</string>
<string name="title_auto_delete_hint">Old messages are messages that are no longer kept on the device</string>
<string name="title_auto_delete_archive_hint">Deletion from the archive folder is not always allowed by the email server</string>
<string name="title_inbox_root_hint">
Some providers require new folders to be created below the inbox.
In this case, you can long press the inbox in the folder list and select \'Create sub folder\'.

Loading…
Cancel
Save