diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt index d5a8a97a1..62a8a834e 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt @@ -47,11 +47,11 @@ class ReadMenu : FrameLayout { vw_bg.onClick { } vwNavigationBar.onClick { } seek_brightness.progress = context.getPrefInt("brightness", 100) - upBrightness() + upBrightnessState() bindEvent() } - private fun upBrightness() { + private fun upBrightnessState() { if (brightnessAuto()) { iv_brightness_auto.setColorFilter(context.accentColor) seek_brightness.isEnabled = false @@ -59,7 +59,6 @@ class ReadMenu : FrameLayout { iv_brightness_auto.setColorFilter(context.buttonDisabledColor) seek_brightness.isEnabled = true } - callBack?.setScreenBrightness(context.getPrefInt("brightness", 100)) } fun runMenuIn() { @@ -93,7 +92,8 @@ class ReadMenu : FrameLayout { "brightnessAuto", !brightnessAuto() ) - upBrightness() + upBrightnessState() + callBack?.setScreenBrightness(context.getPrefInt("brightness", 100)) } seek_brightness.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {