diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1ba3dd2210..aff1851d27 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -196,6 +196,7 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); - ibUp.setVisibility(expanded > 0 ? View.VISIBLE : View.GONE); + ibDown.setVisibility(quick_scroll && expanded > 0 ? View.VISIBLE : View.GONE); + ibUp.setVisibility(quick_scroll && expanded > 0 ? View.VISIBLE : View.GONE); } private void handleExpand(long id) { diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index dddfa5947e..d0f20a78f7 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -39,7 +39,7 @@ public class FragmentOptions extends FragmentBase { static String[] OPTIONS_RESTART = new String[]{ "subscriptions", - "landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread", + "landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread", "color_stripe", "avatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "name_email", "distinguish_contacts", "authentication", "subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", @@ -48,6 +48,7 @@ public class FragmentOptions extends FragmentBase { "contrast", "monospaced", "text_color", "inline_images", "collapse_quotes", "seekbar", "actionbar", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose", + "quick_filter", "quick_scroll", "experiments", "debug", "biometrics" }; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index 123916cbeb..c3c31fe9d3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -52,6 +52,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe private SwitchCompat swExpandOne; private SwitchCompat swAutoClose; private Spinner spOnClose; + private SwitchCompat swQuickFilter; + private SwitchCompat swQuickScroll; private SwitchCompat swCollapseMultiple; private SwitchCompat swAutoRead; private SwitchCompat swAutoUnflag; @@ -62,7 +64,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe private final static String[] RESET_OPTIONS = new String[]{ "double_back", "pull", "autoscroll", "doubletap", "swipenav", "reversed", "autoexpand", "expand_all", "expand_one", "collapse_multiple", - "autoclose", "onclose", "autoread", "autounflag", "automove", "discard_delete", + "autoclose", "onclose", "quick_filter", "quick_scroll", "autoread", "autounflag", "automove", "discard_delete", "default_snooze" }; @@ -88,6 +90,8 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple); swAutoClose = view.findViewById(R.id.swAutoClose); spOnClose = view.findViewById(R.id.spOnClose); + swQuickFilter = view.findViewById(R.id.swQuickFilter); + swQuickScroll = view.findViewById(R.id.swQuickScroll); swAutoRead = view.findViewById(R.id.swAutoRead); swAutoUnflag = view.findViewById(R.id.swAutoUnflag); swAutoMove = view.findViewById(R.id.swAutoMove); @@ -201,6 +205,20 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe } }); + swQuickFilter.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("quick_filter", checked).apply(); + } + }); + + swQuickScroll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("quick_scroll", checked).apply(); + } + }); + swAutoRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -308,6 +326,9 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe spOnClose.setEnabled(!swAutoClose.isChecked()); + swQuickFilter.setChecked(prefs.getBoolean("quick_filter", false)); + swQuickScroll.setChecked(prefs.getBoolean("quick_scroll", true)); + swAutoRead.setChecked(prefs.getBoolean("autoread", false)); swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false)); swAutoMove.setChecked(!prefs.getBoolean("automove", false)); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 14f6c93d2c..ae476a6e06 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -59,6 +59,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swThreading; private SwitchCompat swIndentation; private SwitchCompat swHighlightUnread; + private SwitchCompat swColorStripe; private SwitchCompat swAvatars; private SwitchCompat swGeneratedIcons; private SwitchCompat swIdenticons; @@ -94,7 +95,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swActionbar; private final static String[] RESET_OPTIONS = new String[]{ - "theme", "landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread", + "theme", "landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread", "color_stripe", "avatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "name_email", "distinguish_contacts", "authentication", "subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", @@ -121,6 +122,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swDate = view.findViewById(R.id.swDate); swThreading = view.findViewById(R.id.swThreading); swHighlightUnread = view.findViewById(R.id.swHighlightUnread); + swColorStripe = view.findViewById(R.id.swColorStripe); swAvatars = view.findViewById(R.id.swAvatars); swGeneratedIcons = view.findViewById(R.id.swGeneratedIcons); swIdenticons = view.findViewById(R.id.swIdenticons); @@ -224,6 +226,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + swColorStripe.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("color_stripe", checked).apply(); + } + }); + swAvatars.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -565,6 +574,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swDate.setChecked(prefs.getBoolean("date", true)); swThreading.setChecked(prefs.getBoolean("threading", true)); swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", false)); + swColorStripe.setChecked(prefs.getBoolean("color_stripe", true)); swAvatars.setChecked(prefs.getBoolean("avatars", true)); swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true)); swIdenticons.setChecked(prefs.getBoolean("identicons", false)); diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index 0566a8aad1..6a221a43eb 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -210,6 +210,29 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvOnClose" /> + + + + + + Left/right indent received/sent messages in conversations Highlight unread messages Distinguish messages from known and unknown contacts + Show color stripe Show contact photos Show generated icons Show identicons @@ -310,6 +311,8 @@ Collapse messages in a conversation with multiple messages on \'back\' Automatically close conversations On closing a conversation + Show non-obtrusive quick filter icons + Show non-obtrusive quick scroll up/down icons Automatically mark messages read on moving messages Automatically remove stars from messages on moving messages Confirm moving messages