Created
February 11, 2025 18:09
-
-
Save vitoksmile/f5a21c77274413ddef84db5f54598807 to your computer and use it in GitHub Desktop.
ComposeHints
This file contains hidden or 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
| @Composable | |
| internal fun HintOverlay( | |
| anchor: HintAnchorState, | |
| onDismiss: () -> Unit, | |
| ) { | |
| Popup( | |
| onDismissRequest = onDismiss, | |
| // Set focusable to handle back press events | |
| properties = remember { PopupProperties(focusable = true) }, | |
| ) { | |
| //...draw our hints here | |
| } | |
| } | |
| @Composable | |
| internal fun HintsContainer( | |
| modifier: Modifier, | |
| anchor: HintAnchorState, | |
| onDismiss: () -> Unit, | |
| ) { | |
| Layout( | |
| modifier = modifier | |
| .overlayBackground(anchor) | |
| .clickable( | |
| interactionSource = null, | |
| // Disable ripple | |
| indication = null, | |
| onClick = onDismiss, | |
| ) | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment