From f88a1c806406c8d6228f3b375d81346cef6a3e67 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 11 Mar 2020 09:25:45 +0100 Subject: [PATCH] Improved display settings --- .../email/FragmentOptionsDisplay.java | 24 +++++----- .../res/layout/fragment_options_display.xml | 44 ++++++++++++------- app/src/main/res/values/strings.xml | 3 +- 3 files changed, 42 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index f653dadac7..444819b413 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -65,6 +65,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swThreading; private SwitchCompat swIndentation; + private SwitchCompat swSeekbar; private SwitchCompat swActionbar; private SwitchCompat swHighlightUnread; @@ -105,18 +106,17 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swTextSize; private SwitchCompat swCollapseQuotes; private SwitchCompat swImagesInline; - private SwitchCompat swSeekbar; private final static String[] RESET_OPTIONS = new String[]{ "theme", "startup", "cards", "date", "navbar_colorize", "landscape", "landscape3", - "threading", "indentation", "actionbar", + "threading", "indentation", "seekbar", "actionbar", "highlight_unread", "color_stripe", "avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "name_email", "prefer_contact", "distinguish_contacts", "authentication", "subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", "keywords_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt", "contrast", "monospaced", "text_color", "text_size", - "inline_images", "collapse_quotes", "seekbar" + "inline_images", "collapse_quotes" }; @Override @@ -139,6 +139,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swThreading = view.findViewById(R.id.swThreading); swIndentation = view.findViewById(R.id.swIndentation); + swSeekbar = view.findViewById(R.id.swSeekbar); swActionbar = view.findViewById(R.id.swActionbar); swHighlightUnread = view.findViewById(R.id.swHighlightUnread); @@ -178,7 +179,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swTextSize = view.findViewById(R.id.swTextSize); swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes); swImagesInline = view.findViewById(R.id.swImagesInline); - swSeekbar = view.findViewById(R.id.swSeekbar); setOptions(); @@ -260,6 +260,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + swSeekbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("seekbar", checked).apply(); + } + }); + swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -579,13 +586,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); - swSeekbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("seekbar", checked).apply(); - } - }); - PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); return view; @@ -657,6 +657,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swThreading.setChecked(prefs.getBoolean("threading", true)); swIndentation.setChecked(prefs.getBoolean("indentation", false)); swIndentation.setEnabled(swCards.isChecked()); + swSeekbar.setChecked(prefs.getBoolean("seekbar", false)); swActionbar.setChecked(prefs.getBoolean("actionbar", true)); swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", true)); @@ -724,7 +725,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swTextSize.setChecked(prefs.getBoolean("text_size", true)); swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false)); swImagesInline.setChecked(prefs.getBoolean("inline_images", false)); - swSeekbar.setChecked(prefs.getBoolean("seekbar", false)); updateColor(); } diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 3ac39619fe..17ca327de4 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -219,6 +219,17 @@ app:layout_constraintTop_toBottomOf="@id/tvThreadingHint" app:switchPadding="12dp" /> + + + + - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0e6589cecd..1ed6ef9019 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -300,7 +300,8 @@ General Conversation - Message + Message header + Message body Use two columns in landscape mode Allow fixed navigation menu in landscape mode