mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Fix custom brightness turning off the screen. #106
This commit is contained in:
		| @@ -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) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user