hey guys
looks like drawer gesture doesn't work when using horizontal pager inside scaffold. is there any workaround? maybe we can temporarily disable the pager gestures like we did with views in precompose era?
deviant
08/18/2022, 9:07 AM
i created this modifier for the pager:
Copy code
fun Modifier.edgeBypass(scrollEnabled: MutableState<Boolean>): Modifier = then(Modifier.pointerInput(scrollEnabled) {
val drawerTapArea = 48.dp.toPx()
forEachGesture {
awaitPointerEventScope {
val down = awaitFirstDown(false)
scrollEnabled.value = down.position.x >= drawerTapArea
val up = waitForUpOrCancellation()
scrollEnabled.value = true
}
}
})
it modifies the boolean state when user taps on left edge. then i pass this state to the pager's