From 5abe36ce4467a2bde09919844a4e72eb23ae92c3 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 10 Apr 2019 20:33:51 +0200 Subject: [PATCH] Notifications per account require Android 8 Oreo --- README.md | 2 +- app/src/main/java/eu/faircode/email/FragmentAccount.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d574d33491..b2be727086 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ This app starts a foreground service with a low priority status bar notification ## Pro features * Account/identity colors -* Notifications per account +* Notifications per account (requires Android 8 Oreo or later) * Notifications with message details (requires Android 7 Nougat or later) * Notification sound per sender (requires Android 8 Oreo or later) * Snooze messages ([instructions](https://github.com/M66B/open-source-email/blob/master/FAQ.md#user-content-faq67)) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 6560b65a8f..142fee00d8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -81,6 +81,7 @@ import javax.mail.Store; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Group; import androidx.fragment.app.FragmentTransaction; @@ -398,6 +399,13 @@ public class FragmentAccount extends FragmentBase { } } }); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { + ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) cbNotify.getLayoutParams(); + lparam.width = 0; + lparam.height = 0; + lparam.setMargins(0, 0, 0, 0); + cbNotify.setLayoutParams(lparam); + } btnCheck.setOnClickListener(new View.OnClickListener() { @Override