Skip to content

Commit 487a288

Browse files
fix: removed disableSplitMotionEvents
1 parent 0695fbd commit 487a288

File tree

1 file changed

+1
-21
lines changed
  • feature/interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests

1 file changed

+1
-21
lines changed

feature/interests/src/main/java/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ fun TopicsTabContent(
4242
LazyColumn(
4343
modifier = modifier
4444
.padding(horizontal = 16.dp)
45-
.testTag("interests:topics")
46-
.disableSplitMotionEvents(),
45+
.testTag("interests:topics"),
4746
contentPadding = PaddingValues(top = 8.dp)
4847
) {
4948
topics.forEach { followableTopic ->
@@ -65,22 +64,3 @@ fun TopicsTabContent(
6564
}
6665
}
6766
}
68-
69-
fun Modifier.disableSplitMotionEvents() =
70-
pointerInput(Unit) {
71-
coroutineScope {
72-
var currentId: Long = -1L
73-
awaitPointerEventScope {
74-
while (true) {
75-
awaitPointerEvent(PointerEventPass.Initial).changes.forEach { pointerInfo ->
76-
when {
77-
pointerInfo.pressed && currentId == -1L -> currentId = pointerInfo.id.value
78-
pointerInfo.pressed.not() && currentId == pointerInfo.id.value -> currentId = -1
79-
pointerInfo.id.value != currentId && currentId != -1L -> pointerInfo.consume()
80-
else -> Unit
81-
}
82-
}
83-
}
84-
}
85-
}
86-
}

0 commit comments

Comments
 (0)