Skip to content

Instantly share code, notes, and snippets.

View codingjeremy's full-sized avatar

Jeremy Walker codingjeremy

View GitHub Profile
@codingjeremy
codingjeremy / ointerInputImprovementsBlogpost_After.kt
Created April 13, 2023 17:43
How code executes AFTER the improvement to Compose's Pointer Input.
/* Copyright 2023 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
Box(Modifier
.fillMaxSize()
.pointerInput(Unit) { //<-- Suspends block
awaitPointerEventScope {
while (true) {
val event = awaitPointerEvent()
// Do something with the event.
}
@codingjeremy
codingjeremy / PointerInputImprovementsBlogpost_Before.kt
Last active April 13, 2023 17:41
How code executes before the improvement to Compose's Pointer Input.
/* 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.
}
@codingjeremy
codingjeremy / main.kt
Created February 8, 2020 00:38
Learn how to set a variable in Kotlin
val blah = 22