diff --git a/FAQ.md b/FAQ.md index a620590268..3b18e8cb76 100644 --- a/FAQ.md +++ b/FAQ.md @@ -50,8 +50,7 @@ Related questions: * Go to the next/previous message on archive/delete: in the behavior settings disable *Automatically close conversations* and select *Go to next/previous conversation* for *On closing a conversation* * Add a folder to the unified inbox: long press the folder in the folder list and check *Show in unified inbox* * Add a folder to the navigation menu: long press the folder in the folder list and check *Show in navigation menu* -* Load all messages: long press a folder in the folder list, select *Synchronize all messages*; this will fetch all messages once -* Load older messages: long press a folder in the folder list, select *Edit properties* and change the number of days to sync/keep messages for; please [read this FAQ](#user-content-faq39) +* Load all messages: long press a folder in the folder list, select *Synchronize all/more messages* * Delete a message, skipping trash: in the 3-dots menu of the action bar just above the message text *Delete* or alternatively, unselect the trash folder in the account settings * Delete an account/identity: Setup step 1/2, Manage, tap account/identity, three-dots menu, Delete * Delete a folder: long press the folder in the folder list, Edit properties, three-dots menu, Delete diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 203acb68f4..3090084aa3 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -19,9 +19,11 @@ package eu.faircode.email; Copyright 2018-2020 by Marcel Bokhorst (M66B) */ +import android.app.Dialog; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.ColorStateList; @@ -42,12 +44,15 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.PopupMenu; import androidx.constraintlayout.widget.Group; import androidx.fragment.app.Fragment; @@ -419,7 +424,7 @@ public class AdapterFolder extends RecyclerView.Adapter() { @Override protected Void onExecute(Context context, Bundle args) { - boolean all = args.getBoolean("all"); + int months = args.getInt("months", -1); long fid = args.getLong("folder"); - if (!ConnectionHelper.getNetworkState(context).isSuitable()) + if (months < 0 && !ConnectionHelper.getNetworkState(context).isSuitable()) throw new IllegalStateException(context.getString(R.string.title_no_internet)); boolean now = true; @@ -539,9 +539,12 @@ public class FragmentFolders extends FragmentBase { if (folder == null) return null; - if (all) { + if (months == 0) { db.folder().setFolderInitialize(folder.id, Integer.MAX_VALUE); db.folder().setFolderKeep(folder.id, Integer.MAX_VALUE); + } else if (months > 0) { + db.folder().setFolderInitialize(folder.id, months * 31); + db.folder().setFolderKeep(folder.id, months * 31); } EntityOperation.sync(context, folder.id, true); diff --git a/app/src/main/res/layout/dialog_sync.xml b/app/src/main/res/layout/dialog_sync.xml new file mode 100644 index 0000000000..640f70e7cb --- /dev/null +++ b/app/src/main/res/layout/dialog_sync.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b97993a48c..2e61bb2e16 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -606,7 +606,7 @@ Mark messages read on expanding Synchronize now - Synchronize all messages + Synchronize more messages Synchronize Delete local messages Delete browsed/searched messages @@ -649,6 +649,8 @@ Folder name missing Folder %1$s exists Permanently delete this folder and any messages it contains? + Months + All Unified inbox Inbox @@ -762,7 +764,6 @@ Always show images on showing original messages Showing images can leak privacy sensitive information Images recognized as tracking images will not be shown - Synchronize all messages in %1$s? Delete local messages? Messages will remain on the remote server. Help improve FairEmail Send error reports?