Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Fix custom brightness turning off the screen. #106

Cette révision appartient à :
len 2016-04-18 17:36:27 +02:00
Parent a7840bc247
révision 78314077bb

Voir le fichier

@ -495,13 +495,15 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
private fun setCustomBrightness(enabled: Boolean) {
if (enabled) {
customBrightnessSubscription = preferences.customBrightnessValue().asObservable()
.map { Math.max(0.01f, it) }
.subscribe { setCustomBrightnessValue(it) }
subscriptions.add(customBrightnessSubscription)
} else {
if (customBrightnessSubscription != null)
if (customBrightnessSubscription != null) {
subscriptions.remove(customBrightnessSubscription)
setCustomBrightnessValue(-1f)
}
setCustomBrightnessValue(WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE)
}
}