File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
feature/mobile/player/src/main/java/com/flixclusive/feature/mobile/player Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -272,15 +272,12 @@ internal fun PlayerScreen(
272272 context.requestedOrientation = ActivityInfo .SCREEN_ORIENTATION_SENSOR_LANDSCAPE
273273 context.toggleSystemBars(isVisible = false )
274274
275- // Initialize brightness
276- val userDefaultBrightnessLevel = brightnessManager.currentBrightness
277-
278275 onDispose {
279276 // Lock the screen to landscape only if we're just changing
280277 // episodes. This is really bad code bruh.
281278 if (! isChangingEpisode) {
282279 context.requestedOrientation = ActivityInfo .SCREEN_ORIENTATION_UNSPECIFIED
283- brightnessManager.setBrightness(userDefaultBrightnessLevel )
280+ brightnessManager.unlockBrightnessControl( )
284281 context.toggleSystemBars(isVisible = true )
285282 }
286283
Original file line number Diff line number Diff line change @@ -29,4 +29,10 @@ internal class BrightnessManager(private val activity: Activity) {
2929 layoutParams.screenBrightness = currentBrightness
3030 activity.window.attributes = layoutParams
3131 }
32- }
32+
33+ fun unlockBrightnessControl () {
34+ val layoutParams = activity.window.attributes
35+ layoutParams.screenBrightness = WindowManager .LayoutParams .BRIGHTNESS_OVERRIDE_NONE
36+ activity.window.attributes = layoutParams
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments