mirror of
https://gitlab.com/vyla-entertainment/TV.git
synced 2026-11-15 04:27:21 -05:00
Fixed player UI dismissal bug
This commit is contained in:
@@ -136,6 +136,7 @@ fun PlayerScreen(
|
||||
val setButtonFocusRequester = remember { FocusRequester() }
|
||||
val moreButtonFocusRequester = remember { FocusRequester() }
|
||||
var hideControlsJob by remember { mutableStateOf<Job?>(null) }
|
||||
val playerContainerFocusRequester = remember { FocusRequester() }
|
||||
fun resetHideTimer() {
|
||||
hideControlsJob?.cancel()
|
||||
if (activeMenu == ActivePlayerMenu.NONE && !isEpisodesDrawerOpen && isPlaying) {
|
||||
@@ -144,6 +145,9 @@ fun PlayerScreen(
|
||||
if (isPlaying && activeMenu == ActivePlayerMenu.NONE && !isEpisodesDrawerOpen) {
|
||||
areControlsVisible = false
|
||||
}
|
||||
try {
|
||||
playerContainerFocusRequester.requestFocus()
|
||||
} catch (_: Exception) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,6 +424,7 @@ fun PlayerScreen(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.background(Color.Black)
|
||||
.focusRequester(playerContainerFocusRequester)
|
||||
.focusable()
|
||||
.onKeyEvent { event ->
|
||||
if (event.type == KeyEventType.KeyDown) {
|
||||
|
||||
Reference in New Issue
Block a user