Last active
October 16, 2021 11:08
-
-
Save ch8n/939ba2178b32bde820eda3765df49ddf to your computer and use it in GitHub Desktop.
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 | |
fun CaptureBitmap( | |
content: @Composable ()->Unit // <--- we use callback as parameter | |
){ | |
val composeView = ComposeView(...) | |
AndroidView( | |
factory = { | |
composeView.apply { | |
setContent { | |
content.invoke() // <--- Content get places in between this code | |
} | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment