Fixed player UI dismissal bug

This commit is contained in:
2026-10-24 23:31:46 -04:00
parent 1c4ee48141
commit bb1c084c4c
43 changed files with 8 additions and 4780 deletions

View File

@@ -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) {