feat(player): add controls visibility handling to PlayerGesturesLayer

This commit is contained in:
2026-06-19 15:02:10 +02:00
parent f6c465656e
commit 34340c2bd4
2 changed files with 3 additions and 0 deletions

View File

@@ -154,6 +154,7 @@ fun PlayerScreen(
PlayerGesturesLayer( PlayerGesturesLayer(
modifier = Modifier.align(Alignment.BottomCenter), modifier = Modifier.align(Alignment.BottomCenter),
controlsVisible = controlsVisible,
onTap = ::onScreenTap, onTap = ::onScreenTap,
onDoubleTapRight = { viewModel.seekBy(30_000) }, onDoubleTapRight = { viewModel.seekBy(30_000) },
onDoubleTapLeft = { viewModel.seekBy(-10_000) }, onDoubleTapLeft = { viewModel.seekBy(-10_000) },

View File

@@ -22,6 +22,7 @@ import kotlin.math.abs
@Composable @Composable
fun PlayerGesturesLayer( fun PlayerGesturesLayer(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
controlsVisible: Boolean,
onTap: () -> Unit, onTap: () -> Unit,
onDoubleTapCenter: () -> Unit, onDoubleTapCenter: () -> Unit,
onDoubleTapRight: () -> Unit, onDoubleTapRight: () -> Unit,
@@ -104,6 +105,7 @@ fun PlayerGesturesLayer(
} }
DragDirection.VERTICAL -> { DragDirection.VERTICAL -> {
change.consume() change.consume()
if (controlsVisible) return@drag
val isLeftSide = startX < size.width / 2 val isLeftSide = startX < size.width / 2
if (isLeftSide) { if (isLeftSide) {
onVerticalDragLeft(delta.y) onVerticalDragLeft(delta.y)