From 94ede606039919297f6b92cb123ef79c6c53e8fc Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Oct 2018 14:18:03 +0000 Subject: [PATCH] Persist swipe target --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 5 ++++- 1 file changed, 4 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 99b05d6f..9ea2c4d6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -159,6 +159,8 @@ public class FragmentMessages extends FragmentEx { fab = view.findViewById(R.id.fab); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + if (folder >= 0) + swipeTarget = prefs.getLong("swipe." + folder, -1); // Wire controls @@ -835,6 +837,8 @@ public class FragmentMessages extends FragmentEx { @Override public boolean onMenuItemClick(final MenuItem target) { swipeTarget = target.getItemId(); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + prefs.edit().putLong("swipe." + folder, swipeTarget).apply(); return true; } }); @@ -842,7 +846,6 @@ public class FragmentMessages extends FragmentEx { popupMenu.show(); } }.load(this, args); - } private void loadMessages() {