fix: restrict video player button reordering drag to the drag handle
Move the detectDragGestures pointerInput from the whole button card to the six-dot drag handle icon so drag-and-drop reordering activates only when the user grabs the handle. https://claude.ai/code/session_01Jyu8dLYN7MXVNaVZE3u2M9
This commit is contained in:
+15
-13
@@ -261,18 +261,7 @@ private fun VideoPlayerButtonItemCard(
|
|||||||
scaleX = 1.02f
|
scaleX = 1.02f
|
||||||
scaleY = 1.02f
|
scaleY = 1.02f
|
||||||
}
|
}
|
||||||
}.padding(vertical = 8.dp, horizontal = Size20dp)
|
}.padding(vertical = 8.dp, horizontal = Size20dp),
|
||||||
.pointerInput(Unit) {
|
|
||||||
detectDragGestures(
|
|
||||||
onDragStart = { onDragStart() },
|
|
||||||
onDrag = { change, dragAmount ->
|
|
||||||
change.consume()
|
|
||||||
onDrag(dragAmount.y)
|
|
||||||
},
|
|
||||||
onDragEnd = { onDragEnd() },
|
|
||||||
onDragCancel = { onDragCancel() },
|
|
||||||
)
|
|
||||||
},
|
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -296,7 +285,20 @@ private fun VideoPlayerButtonItemCard(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.size(32.dp),
|
modifier =
|
||||||
|
Modifier
|
||||||
|
.size(32.dp)
|
||||||
|
.pointerInput(Unit) {
|
||||||
|
detectDragGestures(
|
||||||
|
onDragStart = { onDragStart() },
|
||||||
|
onDrag = { change, dragAmount ->
|
||||||
|
change.consume()
|
||||||
|
onDrag(dragAmount.y)
|
||||||
|
},
|
||||||
|
onDragEnd = { onDragEnd() },
|
||||||
|
onDragCancel = { onDragCancel() },
|
||||||
|
)
|
||||||
|
},
|
||||||
contentAlignment = Alignment.CenterEnd,
|
contentAlignment = Alignment.CenterEnd,
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
Reference in New Issue
Block a user