Skip to content

Commit

Permalink
remove -1 for unknown systemBrightnes and default to 0.5 always
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Oct 23, 2024
1 parent 3b015df commit 81b32dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal fun FullscreenGestureUI(
if (LocalContext.current is Activity)
getDefaultBrightness(LocalContext.current as Activity)
else
-1f
0.5f

val embeddedUiConfig =
if (LocalContext.current is Activity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,9 @@ class NewPlayerViewModelImpl @Inject constructor(

override fun brightnessChange(changeRate: Float, systemBrightness: Float) {
mutableUiState.update {
// TODO I would remove this `if`, and rather make it so that `brightnessChange` is
// called only with a valid value for systemBrightness (so replace -1f with 0.5f
// in FullscreenGestureUi
if (it.uiMode.fullscreen) {
val currentBrightness = it.brightness
?: if (systemBrightness < 0f) 0.5f else systemBrightness
?: systemBrightness
Log.d(
TAG,
"currentBrightnes: $currentBrightness, sytemBrightness: $systemBrightness, changeRate: $changeRate"
Expand Down

0 comments on commit 81b32dd

Please sign in to comment.