From ffcffab0cca2bae89e3b446805f658f890e2040f Mon Sep 17 00:00:00 2001 From: XJIOP Date: Fri, 20 Jan 2023 20:40:47 +0100 Subject: [PATCH] updated notification turn on screen --- .../java/org/xjiop/oxygenaodmod/MainActivity.java | 3 ++- .../org/xjiop/oxygenaodmod/NotificationService.java | 2 +- app/src/main/res/xml/settings.xml | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/xjiop/oxygenaodmod/MainActivity.java b/app/src/main/java/org/xjiop/oxygenaodmod/MainActivity.java index 41a258b..571602c 100644 --- a/app/src/main/java/org/xjiop/oxygenaodmod/MainActivity.java +++ b/app/src/main/java/org/xjiop/oxygenaodmod/MainActivity.java @@ -258,7 +258,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } INTERVAL = value; - preference.setSummary(newValue.toString() + " " + getString(R.string.sec)); + preference.setSummary(newValue + " " + getString(R.string.sec)); Helper.showDialogFragment(mContext, MessageDialog.newInstance(getString(R.string.attention), getString(R.string.interval_info))); @@ -467,6 +467,7 @@ else if(requestCode == NOTIFICATION_RESULT) { public void turnOnScreen() { if (isResumed()) { + findPreference("reset_when_screen_turn_on").setEnabled(!TURN_ON_SCREEN); findPreference("show_notification_counter").setEnabled(!TURN_ON_SCREEN); findPreference("color").setEnabled(!TURN_ON_SCREEN); findPreference("icon").setEnabled(!TURN_ON_SCREEN); diff --git a/app/src/main/java/org/xjiop/oxygenaodmod/NotificationService.java b/app/src/main/java/org/xjiop/oxygenaodmod/NotificationService.java index 2d76ba1..8730b2c 100644 --- a/app/src/main/java/org/xjiop/oxygenaodmod/NotificationService.java +++ b/app/src/main/java/org/xjiop/oxygenaodmod/NotificationService.java @@ -276,7 +276,7 @@ public void recountNotifications() { NOTIFICATION_COUNT = 0; INDICATOR_COUNT = 0; - if (!RESET_WHEN_SCREEN_TURN_ON) { + if (!RESET_WHEN_SCREEN_TURN_ON || TURN_ON_SCREEN) { for (StatusBarNotification sbn : getActiveNotifications()) { newNotification(sbn); } diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 0fcf8c0..49a3482 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -45,17 +45,17 @@ app:iconSpaceReserved="false" />