diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 196f80abed..9f66e6f608 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -73,6 +73,7 @@ public class AdapterFolder extends RecyclerView.Adapter 0 ? View.VISIBLE : View.INVISIBLE)); ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE); - ivSubscribed.setVisibility(BuildConfig.DEBUG && folder.subscribed != null && folder.subscribed ? View.VISIBLE : View.GONE); + ivSubscribed.setVisibility(subscriptions && folder.subscribed != null && folder.subscribed ? View.VISIBLE : View.GONE); if (folder.unseen > 0) tvName.setText(context.getString(R.string.title_name_count, @@ -593,6 +594,7 @@ public class AdapterFolder extends RecyclerView.Adapter 0 && subscribed != null); + menu.findItem(R.id.menu_subscribe).setVisible(subscriptions && id > 0 && subscribed != null); menu.findItem(R.id.menu_delete).setVisible(id > 0 && !saving && deletable); super.onPrepareOptionsMenu(menu); } diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index ba6309d2c0..f9b1670b67 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -104,6 +104,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O private SwitchCompat swAutoSend; private SwitchCompat swBadge; + private SwitchCompat swSubscriptions; private SwitchCompat swNotifyPreview; private SwitchCompat swSearchLocal; private SwitchCompat swLight; @@ -124,6 +125,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O "startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic", "flags", "preview", "addresses", "monospaced", "autohtml", "autoimages", "actionbar", "pull", "swipenav", "autoexpand", "autoclose", "autonext", + "subscriptions", "authentication", "debug" }; @@ -134,7 +136,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O "addresses", "monospaced", "autohtml", "autoimages", "actionbar", "pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove", "autoresize", "resize", "prefix_once", "autosend", - "notify_preview", "search_local", "light", "sound", + "subscriptions", "notify_preview", "search_local", "light", "sound", "authentication", "paranoid", "english", "updates", "debug", "first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync", "edit_ref_confirmed", "show_html_confirmed", "show_images_confirmed", "print_html_confirmed", "show_organization", "style_toolbar" @@ -191,6 +193,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O swAutoSend = view.findViewById(R.id.swAutoSend); swBadge = view.findViewById(R.id.swBadge); + swSubscriptions = view.findViewById(R.id.swSubscriptions); swNotifyPreview = view.findViewById(R.id.swNotifyPreview); swSearchLocal = view.findViewById(R.id.swSearchLocal); swLight = view.findViewById(R.id.swLight); @@ -509,6 +512,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O } }); + swSubscriptions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("subscriptions", checked).apply(); + } + }); + swNotifyPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -731,6 +741,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O swAutoSend.setChecked(!prefs.getBoolean("autosend", false)); swBadge.setChecked(prefs.getBoolean("badge", true)); + swSubscriptions.setChecked(prefs.getBoolean("subscriptions", false)); swNotifyPreview.setChecked(prefs.getBoolean("notify_preview", true)); swNotifyPreview.setEnabled(Helper.isPro(getContext())); swSearchLocal.setChecked(prefs.getBoolean("search_local", false)); diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml index 8e5b4687f3..06943203e8 100644 --- a/app/src/main/res/layout/fragment_options.xml +++ b/app/src/main/res/layout/fragment_options.xml @@ -789,6 +789,31 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swBadge" /> + + + + Confirm sending messages Show launcher icon with number of new messages + Manage folder subscriptions Show message preview in notifications External search on device Use notification light @@ -214,6 +215,7 @@ Group messages related to each other When disabled only names will be shown when available Note that starred messages will always be kept locally + Folders not subscribed to will be hidden Only available when message text was downloaded Automatically open message when there is just one message or just one unread message in a conversation