From 084265a1ce6f16a05ce3b1cf9016f6cb520e0794 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 14 Feb 2019 08:55:20 +0000 Subject: [PATCH] Always collapse multiple expanded messages --- .../eu/faircode/email/FragmentMessages.java | 7 +-- app/src/main/res/layout/fragment_options.xml | 43 ++++++++++++------- app/src/main/res/values/strings.xml | 17 ++++---- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index c92beebb70..24062100bb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -2478,13 +2478,14 @@ public class FragmentMessages extends FragmentBase { return true; } - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - if (prefs.getBoolean("collapse", false)) - if (values.containsKey("expanded") && values.get("expanded").size() > 0) { + if (values.containsKey("expanded")) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + if (values.get("expanded").size() > 1 || prefs.getBoolean("collapse", false)) { values.get("expanded").clear(); adapter.notifyDataSetChanged(); return true; } + } return false; } diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml index c7fe41c7c5..699c86bf0d 100644 --- a/app/src/main/res/layout/fragment_options.xml +++ b/app/src/main/res/layout/fragment_options.xml @@ -462,17 +462,42 @@ app:layout_constraintTop_toBottomOf="@id/swAutoExpand" /> + + + + - - Miscellaneous Synchronize + Check for updates Use metered connections Automatically download messages and attachments on a metered connection up to @@ -158,24 +159,21 @@ Automatically show images for known contacts Conversation action bar - Show message preview in notifications - Use notification light - Select notification sound - Pull down to refresh - Automatically expand messages - Automatically close conversations Swipe left/right to go to next/previous conversation + Automatically expand messages + Collapse messages in conversations on \'back\' + Automatically close conversations Automatically go to next conversation on close conversation Automatically mark messages read on moving messages - Collapse messages in conversations on \'back\' Confirm moving messages - Confirm actions that might leak privacy sensitive information Automatically resize images for displaying on screens Allow editing sender address Confirm sending messages - Check for updates + Show message preview in notifications + Use notification light + Select notification sound Debug mode Globally disable or enable receiving and sending of messages @@ -186,6 +184,7 @@ When disabled only names will be shown when available Only available when message text was downloaded Automatically open message when there is just one message or just one unread message in a conversation + Multiple expanded messages will always be closed on \'back\' Automatically close conversations when all messages are archived, sent or trashed Most providers do not allow modified sender addresses