mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
feat(player): add controls visibility handling to PlayerGesturesLayer
This commit is contained in:
@@ -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) },
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user