I'm migrating from standard Android to Jetpack Compose but I'm having a problem. I don't know how to "convert" the following implementation:
Standard Android:
- I call a function and receive a View.
- I use the FrameLayout
addView()method call to fill myFrameLayoutwith the received view.
How can I do it in composing?
In composing using a FrameLayout means to use a Box but I don't know how I can fill it with my received view.
Could anyone suggest to me the correct way?
here the code:
@Composable
fun MyCard(testActivity: Activity? = null) {
AdvertView(testActivity) { view ->
Box(modifier = Modifier.fillMaxSize()) {
AndroidView(factory = { view })
}
}
}
