Skip to content

Commit

Permalink
Android crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aclassen committed Nov 16, 2021
1 parent 279f091 commit 58e0f50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reorderable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = "org.burnoutcrew.composereorderable"
version = "0.7.1"
version = "0.7.2"

kotlin {
android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.*
import androidx.compose.ui.platform.ViewConfiguration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastAll
import androidx.compose.ui.util.fastAny
import androidx.compose.ui.util.fastFirstOrNull
import kotlinx.coroutines.TimeoutCancellationException
Expand Down Expand Up @@ -89,13 +90,13 @@ internal suspend fun PointerInputScope.awaitLongPressOrCancellation(
var finished = false
while (!finished) {
val event = awaitPointerEvent(PointerEventPass.Main)
if (event.changes.all { it.changedToUpIgnoreConsumed() }) {
if (event.changes.fastAll { it.changedToUpIgnoreConsumed() }) {
// All pointers are up
finished = true
}


if (event.changes.any { it.consumed.downChange || it.isOutOfBounds(size, extendedTouchPadding) }) {
if (event.changes.fastAny { it.consumed.downChange || it.isOutOfBounds(size, extendedTouchPadding) }) {
finished = true // Canceled
}

Expand Down

0 comments on commit 58e0f50

Please sign in to comment.