-
-
Save andreymusth/4dc80ef19a4f1f99b79be7603c45c16e to your computer and use it in GitHub Desktop.
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
fun Modifier.pointerInput( | |
key1: Any?, | |
block: suspend PointerInputScope.() -> Unit | |
): Modifier = composed( | |
... | |
) { | |
val density = LocalDensity.current | |
val viewConfiguration = LocalViewConfiguration.current | |
remember(density) { SuspendingPointerInputFilter(viewConfiguration, density) }.apply { | |
LaunchedEffect(this, key1) { | |
block() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment