Alex Styl
03/17/2023, 1:36 PMModifier.pointerInput(Unit) {
detectTapGestures(
onPress = { offset ->
// pressed
awaitRelease()
// released
}
)
}
I am using the above code to detect when the user keeps holding on a Box
. The issue is that when I tap and hold on the box and then move my finger outside the bounds of the Box, then awaitRelease()
is never unblocked.
is there a way for awaitRelease() to be done when the user releases their finger even outside the composable they started pressing on?Albert Chang
03/17/2023, 3:29 PMGestureCancellationException
will be thrown so you can just check that.