From 25668bb7626e25d69a491363b9bc1f4891becbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Mon, 5 Sep 2022 22:54:03 +0100 Subject: [PATCH] Prefer long notification text by default --- .../gadgetbridge/externalevents/NotificationListener.java | 2 +- app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/notifications_preferences.xml | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index 5c7a4ebf0..e5aa56d58 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -370,7 +370,7 @@ public class NotificationListener extends NotificationListenerService { LOG.info("Processing notification " + notificationSpec.getId() + " age: " + (System.currentTimeMillis() - notification.when) + " from source " + source + " with flags: " + notification.flags); - boolean preferBigText = source.startsWith("com.fsck.k9") || source.equals("com.google.android.gm"); + boolean preferBigText = prefs.getBoolean("notification_prefer_long_text", true); dissectNotificationTo(notification, notificationSpec, preferBigText); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5391a3c43..f6da18292 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -200,6 +200,8 @@ …also when screen is on Ignore low priority notifications Do not send low and minimum priority notifications to the watch + Prefer long notification text + If available, send the long notification text to the device Do Not Disturb Block all notifications when Do Not Disturb is enabled on the phone Per application settings diff --git a/app/src/main/res/xml/notifications_preferences.xml b/app/src/main/res/xml/notifications_preferences.xml index 3a346335b..92f805745 100644 --- a/app/src/main/res/xml/notifications_preferences.xml +++ b/app/src/main/res/xml/notifications_preferences.xml @@ -24,6 +24,13 @@ android:title="@string/pref_title_notifications_ignore_low_priority" android:summary="@string/pref_summary_notifications_ignore_low_priority" /> + +