Daniel
03/01/2021, 7:05 PMPointerInputScope.awaitFirstDown should have an inverse, but I wanted to check if anyone saw anything obvious I was missing first.
private suspend fun PointerInputScope.awaitChangedToUp(id: PointerId) {
awaitPointerEventScope {
do {
val event = awaitPointerEvent().changes.fastFirstOrNull { it.id == id }
event?.consumeAllChanges()
} while (event?.changedToUp() != true)
}
}Tash
03/01/2021, 7:08 PMTash
03/01/2021, 7:09 PMDaniel
03/01/2021, 7:20 PMDaniel
03/01/2021, 7:22 PMtryAwaitRelease works in a detectTapGestures , which loops infinitely looking for tap gestures, making it hard to combine with other detectorsTash
03/01/2021, 7:24 PMawaitTapUp or something will be useful to combine with await.. + drag { }Tash
03/01/2021, 7:25 PMDaniel
03/01/2021, 7:29 PMDaniel
03/01/2021, 7:31 PMDaniel
03/01/2021, 7:31 PMDaniel
03/01/2021, 7:31 PMTash
03/01/2021, 7:43 PMDaniel
03/01/2021, 7:46 PMDaniel
03/01/2021, 8:15 PMTash
03/01/2021, 8:16 PMwhen statement.Tash
03/01/2021, 8:20 PMawaitChangedToUp you are doing event?.consumeAllChanges() . Is that being done because you need to consume the up + minute position changes as well?Daniel
03/01/2021, 8:21 PMDaniel
03/01/2021, 8:21 PMDaniel
03/01/2021, 8:22 PMDaniel
03/01/2021, 8:22 PMDaniel
03/01/2021, 8:23 PMTash
03/01/2021, 8:24 PMconsumeAllChanges() instead of just consumeDownChange()Daniel
03/01/2021, 8:25 PM