From d4c8d0f96d13f19427403d61a2eef23a51db2589 Mon Sep 17 00:00:00 2001 From: Navid Date: Fri, 19 Jan 2024 15:28:23 -0500 Subject: [PATCH 1/3] Alert Settings cleanup --- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/pref_notifications.xml | 82 ++++++++++++--------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f270876906..1327aa7986 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1479,6 +1479,7 @@ Whether notifications should be grouped together. Incompatible with \'Number Item in Notification Area\' option Group notifications together For ascending volume profile, delay the start of the alert sound by 3 minutes. The vibration (if enabled) starts as soon as the alert triggers regardless of this setting. + Ascending Volume settings Delay Ascending Volume Play sound when Initial Calibration is requested Initial Alert diff --git a/app/src/main/res/xml/pref_notifications.xml b/app/src/main/res/xml/pref_notifications.xml index 2ce07f3d94..222f8ecbb0 100644 --- a/app/src/main/res/xml/pref_notifications.xml +++ b/app/src/main/res/xml/pref_notifications.xml @@ -93,44 +93,54 @@ android:summary="@string/create_shortcut" android:title="@string/shortcut_to_bg_alerts" /> - - - - - - + + + + - + + + + + - + + + From 9dcc16a68f8abb6818fe8b1cd06731f8c430a943 Mon Sep 17 00:00:00 2001 From: Navid Date: Wed, 10 Apr 2024 23:45:29 -0400 Subject: [PATCH 2/3] Ascend to medium --- .../eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java | 3 +++ app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/pref_notifications.xml | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java index 86c63652a7..9ddd04ba7d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java @@ -554,6 +554,9 @@ protected void VibrateNotifyMakeNoise(Context context, AlertType alert, String b } volumeFrac = Math.max(volumeFrac, 0); // Limit volumeFrac to values greater than and equal to 0 volumeFrac = Math.min(volumeFrac, 1); // Limit volumeFrac to values less than and equal to 1 + if (Pref.getBooleanDefaultFalse("ascending_volume_to_medium")) { // If ascending_volume_to_medium is enabled + volumeFrac = Math.min(volumeFrac, (float) 0.7); // Clamp the ascending volume at the medium level. + } if (profile == ALERT_PROFILE_MEDIUM) { volumeFrac = (float) 0.7; } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 90d3f601f0..16991739b5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1494,6 +1494,8 @@ For ascending volume profile, delay the start of the alert sound by 3 minutes. The vibration (if enabled) starts as soon as the alert triggers regardless of this setting. Ascending Volume settings Delay Ascending Volume + When enabled, ascending volume profile will ascend to medium volume instead of maximum + Ascend to medium Play sound when Initial Calibration is requested Initial Alert Noisy Readings diff --git a/app/src/main/res/xml/pref_notifications.xml b/app/src/main/res/xml/pref_notifications.xml index aa4e47e3ed..587c470d52 100644 --- a/app/src/main/res/xml/pref_notifications.xml +++ b/app/src/main/res/xml/pref_notifications.xml @@ -140,6 +140,11 @@ android:key="delay_ascending_3min" android:summary="@string/summary_delay_ascending_3min" android:title="@string/title_delay_ascending_3min" /> + From 79a4d3b2f81bc3e0cb97181bc0a2f128058fdf9f Mon Sep 17 00:00:00 2001 From: Navid Date: Thu, 11 Apr 2024 00:05:04 -0400 Subject: [PATCH 3/3] Correct High profile --- .../com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java index 9ddd04ba7d..5a168db92d 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/AlertPlayer.java @@ -554,7 +554,7 @@ protected void VibrateNotifyMakeNoise(Context context, AlertType alert, String b } volumeFrac = Math.max(volumeFrac, 0); // Limit volumeFrac to values greater than and equal to 0 volumeFrac = Math.min(volumeFrac, 1); // Limit volumeFrac to values less than and equal to 1 - if (Pref.getBooleanDefaultFalse("ascending_volume_to_medium")) { // If ascending_volume_to_medium is enabled + if (Pref.getBooleanDefaultFalse("ascending_volume_to_medium") && profile == ALERT_PROFILE_ASCENDING) { // If ascending volume profile is chosen and ascending_volume_to_medium is enabled volumeFrac = Math.min(volumeFrac, (float) 0.7); // Clamp the ascending volume at the medium level. } if (profile == ALERT_PROFILE_MEDIUM) {