From 264169c135fd2b40df8b265414e1e982e0f729cf Mon Sep 17 00:00:00 2001 From: DHD2280 Date: Fri, 13 Dec 2024 21:12:47 +0100 Subject: [PATCH] Reformat seconds Signed-off-by: DHD2280 --- .../utils/PreferenceHelper.java | 19 +++++++++---------- app/src/main/res/values/strings.xml | 1 + 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java b/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java index 75b23a71..7cc0c0dd 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java @@ -175,7 +175,6 @@ import java.util.Collections; import java.util.List; -import it.dhd.oneplusui.preference.OplusListPreference; import it.dhd.oneplusui.preference.OplusSliderPreference; import it.dhd.oneplusui.preference.OplusSwitchPreference; import it.dhd.oxygencustomizer.BuildConfig; @@ -904,9 +903,6 @@ public static boolean isEnabled(String key) { instance.mPreferences.getBoolean("fix_lag_switch", false) && !instance.mPreferences.getBoolean("fix_lag_force_all_apps", false); - case "SleepOnFlatScreen" -> - instance.mPreferences.getBoolean("SleepOnFlatScreen", false); - case "moreLogging" -> !BuildConfig.VERSION_NAME.contains("nightly"); default -> true; @@ -998,12 +994,12 @@ public static String getSummary(Context fragmentCompat, @NonNull String key) { instance.mPreferences.getSliderInt("status_bar_clock_size", 12) + "sp"; case "status_bar_clock_auto_hide_hduration" -> fragmentCompat.getString(R.string.status_bar_clock_auto_hide_hdur_summary) + "\n" + - instance.mPreferences.getSliderInt("status_bar_clock_auto_hide_hduration", 60) + " " + - fragmentCompat.getString(R.string.seconds); + String.format(fragmentCompat.getString(R.string.duration_seconds), + instance.mPreferences.getSliderInt("status_bar_clock_auto_hide_hduration", 60)); case "status_bar_clock_auto_hide_sduration" -> fragmentCompat.getString(R.string.status_bar_clock_auto_hide_sdur_summary) + "\n" + - instance.mPreferences.getSliderInt("status_bar_clock_auto_hide_sduration", 5) + " " + - fragmentCompat.getString(R.string.seconds); + String.format(fragmentCompat.getString(R.string.duration_seconds), + instance.mPreferences.getSliderInt("status_bar_clock_auto_hide_sduration", 5)); case NOTIF_TRANSPARENCY_VALUE -> String.valueOf(instance.mPreferences.getSliderInt(NOTIF_TRANSPARENCY_VALUE, 25)); @@ -1139,8 +1135,11 @@ public static String getSummary(Context fragmentCompat, @NonNull String key) { // Buttons case "volbtn_torch_timeout" -> - instance.mPreferences.getSliderInt("volbtn_torch_timeout", 5) + " " + - fragmentCompat.getString(R.string.seconds); + String.format(fragmentCompat.getString(R.string.duration_seconds), instance.mPreferences.getSliderInt("volbtn_torch_timeout", 5)); + + // Screen Off On Flat + case "FlatStandbyTime" -> + String.format(fragmentCompat.getString(R.string.duration_seconds), instance.mPreferences.getSliderInt("FlatStandbyTime", 5)); default -> null; }; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f77576c9..a5700ec1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -81,6 +81,7 @@ Battery Level %d%% Seconds + %d seconds Milliseconds Steps Accent 1