From 9296b25704d6dccd3a047076f9c4dbddf91c9731 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 9 Jan 2021 16:30:52 +0100 Subject: [PATCH] Shed some light --- FAQ.md | 11 +++++------ .../faircode/email/FragmentOptionsNotifications.java | 9 +++++++++ .../res/drawable/baseline_wb_incandescent_24.xml | 10 ++++++++++ .../res/layout/fragment_options_notifications.xml | 12 +++++++++++- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/drawable/baseline_wb_incandescent_24.xml diff --git a/FAQ.md b/FAQ.md index cea45cf77e..b13f2de734 100644 --- a/FAQ.md +++ b/FAQ.md @@ -967,16 +967,15 @@ and I expect that you take responsibility for informing yourself of what you are **(21) How do I enable the notification light?** -Before Android 8 Oreo: there is an advanced option in the setup for this. +Before Android 8 Oreo: there is an advanced option in the notification settings of the app for this. + +Android 8 Oreo and later: please see [here](https://developer.android.com/training/notify-user/channels) about how to configure notification channels. +You can use the button *Default channel* in the notification settings of the app to directly go to the right Android notification channel settings. -Android 8 Oreo and later: see [here](https://developer.android.com/training/notify-user/channels) about how to configure notification channels. -You can use the button *Manage notifications* in the setup to directly go to the Android notification settings. Note that apps cannot change notification settings, including the notification light setting, on Android 8 Oreo and later anymore. -Apps designed and targeting older Android versions might still be able to control the contents of notifications, -but such apps cannot be updated anymore and recent Android versions will show a warning that such apps are outdated. Sometimes it is necessary to disable the setting *Show message preview in notifications* -or to enable the settings *Show notifications with a preview text only* to workaround a bug in Android. +or to enable the settings *Show notifications with a preview text only* to workaround bugs in Android. This might apply to notification sounds and vibrations too. Setting a light color before Android 8 is not supported and on Android 8 and later not possible. diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java index cc9910f046..73b3adddaa 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java @@ -87,6 +87,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared private SwitchCompat swNotifyPreview; private SwitchCompat swNotifyPreviewAll; private SwitchCompat swNotifyPreviewOnly; + private ImageButton ibLight; private SwitchCompat swWearablePreview; private ImageButton ibWearable; private SwitchCompat swMessagingStyle; @@ -156,6 +157,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared swNotifyPreview = view.findViewById(R.id.swNotifyPreview); swNotifyPreviewAll = view.findViewById(R.id.swNotifyPreviewAll); swNotifyPreviewOnly = view.findViewById(R.id.swNotifyPreviewOnly); + ibLight = view.findViewById(R.id.ibLight); swWearablePreview = view.findViewById(R.id.swWearablePreview); ibWearable = view.findViewById(R.id.ibWearable); swMessagingStyle = view.findViewById(R.id.swMessagingStyle); @@ -399,6 +401,13 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared } }); + ibLight.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Helper.viewFAQ(v.getContext(), 21); + } + }); + swWearablePreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { diff --git a/app/src/main/res/drawable/baseline_wb_incandescent_24.xml b/app/src/main/res/drawable/baseline_wb_incandescent_24.xml new file mode 100644 index 0000000000..a2bf0dafaa --- /dev/null +++ b/app/src/main/res/drawable/baseline_wb_incandescent_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/fragment_options_notifications.xml b/app/src/main/res/layout/fragment_options_notifications.xml index 47bf6c909f..958eced8c9 100644 --- a/app/src/main/res/layout/fragment_options_notifications.xml +++ b/app/src/main/res/layout/fragment_options_notifications.xml @@ -511,6 +511,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swNotifyPreviewOnly" /> + +