Last active
April 13, 2023 17:41
-
-
Save codingjeremy/e2bd9868dcd4656f3b129b70aae07cb8 to your computer and use it in GitHub Desktop.
How code executes before the improvement to Compose's Pointer Input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2023 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
Box(Modifier | |
.fillMaxSize() | |
.pointerInput(Unit) { | |
awaitPointerEventScope { //<-- Executes | |
while (true) { //<-- Executes | |
val event = awaitPointerEvent() //<-- Suspends | |
// Do something with the event. | |
} | |
} | |
} | |
) { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment