From c1386a42be91d8d8e66b479f53d0bdc0fdfc597a Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 24 Nov 2018 10:32:21 +0100 Subject: [PATCH] Made account notifications pro --- .../eu/faircode/email/FragmentAccount.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 45bd41976e..c37a68fe30 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -391,6 +391,20 @@ public class FragmentAccount extends FragmentEx { } }); + cbNotify.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (isChecked && !Helper.isPro(getContext())) { + cbNotify.setChecked(false); + + FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); + fragmentTransaction.hide(FragmentAccount.this); + fragmentTransaction.add(R.id.content_frame, new FragmentPro()).addToBackStack("pro"); + fragmentTransaction.commit(); + } + } + }); + cbSynchronize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -726,6 +740,11 @@ public class FragmentAccount extends FragmentEx { if (account.primary) db.account().resetPrimary(); + if (!Helper.isPro(context)) { + account.color = null; + account.notify = false; + } + if (update) db.account().updateAccount(account); else