From 8582ccb97a8cd585df36302805c942e235504268 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 2 Mar 2020 18:31:18 +0100 Subject: [PATCH] Reversed auto close --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 557ee60b14..42fa8ca863 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4040,7 +4040,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. finish(); else { Log.i("Navigating to id=" + closeId); - navigate(closeId, "previous".equals(onclose)); + + Context context = getContext(); + if (context == null) + finish(); + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + boolean reversed = prefs.getBoolean("reversed", false); + navigate(closeId, "previous".equals(onclose) ^ reversed); } } }