This commit is contained in:
oSumAtrIX 2024-04-06 00:36:09 +02:00
parent a24697256d
commit 5026c50a67
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -124,18 +124,14 @@ class SwipeControlsOverlayLayout(
}
override fun onBrightnessChanged(brightness: Double) {
Settings.SWIPE_BRIGHTNESS_AUTO_STATE.save(false)
if (config.shouldEnableAutoBrightness) {
if (brightness > 0) {
showFeedbackView("${round(brightness).toInt()}%", manualBrightnessIcon)
} else {
showFeedbackView(str("revanced_swipe_enable_auto_brightness_overlay_text"), autoBrightnessIcon)
Settings.SWIPE_BRIGHTNESS_AUTO_STATE.save(true)
}
val useAutoBrightness = config.shouldEnableAutoBrightness && brightness == 0.0
Settings.SWIPE_BRIGHTNESS_AUTO_STATE.save(useAutoBrightness)
if (useAutoBrightness) {
showFeedbackView(str("revanced_swipe_enable_auto_brightness_overlay_text"), autoBrightnessIcon)
} else {
if (brightness >= 0) {
showFeedbackView("${round(brightness).toInt()}%", manualBrightnessIcon)
}
showFeedbackView("${round(brightness).toInt()}%", manualBrightnessIcon)
}
}
@ -148,4 +144,4 @@ class SwipeControlsOverlayLayout(
)
}
}
}
}