mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
feat(player): add controls visibility handling to PlayerGesturesLayer
This commit is contained in:
@@ -154,6 +154,7 @@ fun PlayerScreen(
|
||||
|
||||
PlayerGesturesLayer(
|
||||
modifier = Modifier.align(Alignment.BottomCenter),
|
||||
controlsVisible = controlsVisible,
|
||||
onTap = ::onScreenTap,
|
||||
onDoubleTapRight = { viewModel.seekBy(30_000) },
|
||||
onDoubleTapLeft = { viewModel.seekBy(-10_000) },
|
||||
|
||||
@@ -22,6 +22,7 @@ import kotlin.math.abs
|
||||
@Composable
|
||||
fun PlayerGesturesLayer(
|
||||
modifier: Modifier = Modifier,
|
||||
controlsVisible: Boolean,
|
||||
onTap: () -> Unit,
|
||||
onDoubleTapCenter: () -> Unit,
|
||||
onDoubleTapRight: () -> Unit,
|
||||
@@ -104,6 +105,7 @@ fun PlayerGesturesLayer(
|
||||
}
|
||||
DragDirection.VERTICAL -> {
|
||||
change.consume()
|
||||
if (controlsVisible) return@drag
|
||||
val isLeftSide = startX < size.width / 2
|
||||
if (isLeftSide) {
|
||||
onVerticalDragLeft(delta.y)
|
||||
|
||||
Reference in New Issue
Block a user