I'm already sick of this shitty code πŸ™ƒ

This commit is contained in:
MarcaDian 2024-04-11 13:36:50 +03:00
parent 7dd6a28c3f
commit 2a1916bf6e
No known key found for this signature in database
GPG Key ID: 904EF10755E7C016
2 changed files with 5 additions and 2 deletions

View File

@ -244,7 +244,7 @@ public class Settings extends BaseSettings {
public static final LongSetting SWIPE_OVERLAY_TIMEOUT = new LongSetting("revanced_swipe_overlay_timeout", 500L, true,
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
public static final BooleanSetting SWIPE_SAVE_AND_RESTORE_BRIGHTNESS = new BooleanSetting("revanced_swipe_save_and_restore_brightness", TRUE, true, parent(SWIPE_BRIGHTNESS));
public static final FloatSetting SWIPE_BRIGHTNESS_VALUE = new FloatSetting("revanced_swipe_brightness_value", -1f);
public static final FloatSetting SWIPE_BRIGHTNESS_VALUE = new FloatSetting("revanced_swipe_brightness_value", 0.5f);
public static final BooleanSetting SWIPE_ENABLE_LOWEST_VALUE_AUTO_BRIGHTNESS = new BooleanSetting("revanced_swipe_enable_lowest_value_auto_brightness", TRUE, true, parent(SWIPE_BRIGHTNESS));
// Debugging
/**

View File

@ -50,9 +50,12 @@ class ScreenBrightnessController(
* restore the screen brightness from settings saved using [save]
*/
fun restore() {
// after force close app, 'savedScreenBrightnessValue' resets to default from settings ('0.5f').
// so default value in settings should not be '-1f'
// `-1f` means auto-brightness activated
if (config.savedScreenBrightnessValue != -1f) {
rawScreenBrightness = config.savedScreenBrightnessValue
config.savedScreenBrightnessValue = -1f // Reset the saved brightness value
config.savedScreenBrightnessValue = -1f
}
}