Created
February 11, 2025 18:07
-
-
Save vitoksmile/b607888184a6b33a37483d0bbe37a8a7 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
| @Stable | |
| class HintController internal constructor() { | |
| internal var hint by mutableStateOf<HintAnchorState?>(null) | |
| fun show(hint: HintAnchorState) { | |
| this.hint = hint | |
| } | |
| } | |
| @Composable | |
| fun rememberHintController(): HintController { | |
| val controller = remember { HintController() } | |
| controller.hint?.let { hint -> | |
| HintOverlay(anchor = hint) | |
| } | |
| return controller | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment