mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-06-02 19:36:30 +02:00
refactor
This commit is contained in:
parent
a24697256d
commit
5026c50a67
|
@ -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(
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user