r2-testapp-kotlin icon indicating copy to clipboard operation
r2-testapp-kotlin copied to clipboard

Brightness settings uses default brightness value when at minimum on some devices

Open Sought opened this issue 4 years ago • 0 comments

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.

Sought avatar Jan 16 '20 16:01 Sought