From 86afc0d1d55e949a0c7dce6e53a295b9df571ffc Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 13 Sep 2018 10:29:07 +0000 Subject: [PATCH] Made sort pro feature --- README.md | 1 + .../eu/faircode/email/FragmentMessages.java | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 90df93eb..f3fc007f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Pro features * Signatures * Account colors * Standard replies +* Sort on time, unread or starred * Progressive search (first local, then server) * Preview sender/subject in new messages status bar notification diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index a5f26b2a..37222302 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -564,15 +564,16 @@ public class FragmentMessages extends FragmentEx { return true; case R.id.menu_sort_on_unread: - prefs.edit().putString("sort", "unread").apply(); - item.setChecked(true); - loadMessages(); - return true; - case R.id.menu_sort_on_starred: - prefs.edit().putString("sort", "starred").apply(); - item.setChecked(true); - loadMessages(); + if (prefs.getBoolean("pro", false)) { + prefs.edit().putString("sort", item.getItemId() == R.id.menu_sort_on_unread ? "unread" : "starred").apply(); + item.setChecked(true); + loadMessages(); + } else { + FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro"); + fragmentTransaction.commit(); + } return true; case R.id.menu_folders: