File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
new-player/src/main/java/net/newpipe/newplayer Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ fun NewPlayerUI(
149149 val defaultBrightness = getDefaultBrightness(activity)
150150
151151 setScreenBrightness(
152- uiState.brightness ? : defaultBrightness, activity
152+ if ( uiState.brightness < 0 ) defaultBrightness else uiState.brightness , activity
153153 )
154154 }
155155
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ internal fun LockScreenOrientation(orientation: Int) {
7272internal fun getDefaultBrightness (activity : Activity ): Float {
7373 val window = activity.window
7474 val layout = window.attributes as WindowManager .LayoutParams
75- return if (layout.screenBrightness < 0 ) 0.5f else layout.screenBrightness
75+ return if (layout.screenBrightness < 0 ) - 1f else layout.screenBrightness
7676}
7777
7878@SuppressLint(" NewApi" )
Original file line number Diff line number Diff line change @@ -103,9 +103,9 @@ data class NewPlayerUIState(
103103 val soundVolume : Float ,
104104
105105 /* *
106- * The brightness volume. Might be null if the system is in control of the brightness.
106+ * The brightness volume. Might be negative if the system is in control of the brightness.
107107 */
108- val brightness : Float? ,
108+ val brightness : Float ,
109109
110110 /* *
111111 * This is used to restore several values when switching back from a fullscreen view to an
@@ -214,7 +214,7 @@ data class NewPlayerUIState(
214214 playbackPositionInMs = 0 ,
215215 fastSeekSeconds = 0 ,
216216 soundVolume = 0f ,
217- brightness = null ,
217+ brightness = - 1f ,
218218 embeddedUiConfig = null ,
219219 playList = emptyList(),
220220 chapters = emptyList(),
You can’t perform that action at this time.
0 commit comments