I have LazyRow which has a child which can pan and zoom. When the row is scrolled horizontally all events are intercepted by LazyList until the scrolling animation is finished. What I want to do - during scrolling animation tap the item and pan it vertically
LazyRow(
modifier = Modifier
.fillMaxSize()
.pointerInput(Unit) {
coroutineScope {
awaitPointerEventScope {
Timber.e("awaitEachGesture awaitPointerEventScope")
var pan = Offset.Zero
var pastTouchSlop = false
val touchSlop = viewConfiguration.touchSlop
while (true) {
val event = awaitPointerEvent()
val consumed = event.changes.fastAny { it.isConsumed }
if (!consumed) {
Timber.e("awaitEachGesture lazyList ${event.type}")
if (event.type == PointerEventType.Release) {
pan = Offset.Zero
pastTouchSlop = false
listTouchEnded = System.currentTimeMillis()
} else if (event.type == PointerEventType.Move) {
if (event.changes.size == 1) {
val panChange = event.calculatePan()
if (!pastTouchSlop) {
pan += panChange
val panMotion = pan.getDistance()
if (panMotion > touchSlop) {
pastTouchSlop = true
}
} else {
if (!pan.slopHorizontal()) {
listOffset = panChange.y
// event.changes.forEach {
// if (it.positionChanged()) {
// it.consume()
// }
// }
}
}
}
}
}
}
}
}
},