r2-testapp-kotlin
r2-testapp-kotlin copied to clipboard
Brightness settings uses default brightness value when at minimum on some devices
Steps to reproduce:
- Open any EPUB, go to settings, and move the brightness scrollbar to the lowest value possible
Result expected:
- Minimal value.
Result observed:
- Default brightness was used.
Tested on:
- Xiaomi A3 phone - does have the issue
- Huawei BTV-W09 tablet - doesn't have this issue.
What to do?
- https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#screenBrightness
The code present in UserSettings.kt probably sets the screen brightness to a near 0 float value that is negative. An hotfix snippet setting it to 0.01.toFloat() fixed the issue.