Kevin Hester
03/30/2020, 4:38 AMMihai Popa
03/30/2020, 9:59 AMViewGroup
is emitted during composition and we are handling it being composed here: https://osscs.corp.google.com/androidx/platform/frameworks/support/+/androidx-master-dev:ui/ui-framework/src/main/java/androidx/ui/node/UiComposer.kt;l=134?q=uicomposer.ktLayoutNode
in Compose's internal representation to represent the View
Kevin Hester
03/30/2020, 5:28 PMMihai Popa
03/30/2020, 5:46 PMView
, but the Compose runtime will handle the creation of `View`s when you emit them (i.e. use the DSL-style syntax as if you executed a @Composable
but with a View
instead). This is how AndroidViewHolder
is emitted, not just createdView
during composition, we will add the view as non-direct child of AndroidComposeView
, so it will be attached to windows, etc.Kevin Hester
03/30/2020, 5:48 PMMihai Popa
03/30/2020, 5:50 PMKevin Hester
03/30/2020, 5:53 PM@Composable
// TODO(popam): support modifiers here
fun AndroidView(@LayoutRes resId: Int, postInflationCallback: (View) -> Unit = { _ -> }) {
AndroidViewHolder()
//r.postInflationCallback = postInflationCallback
//r.resId = resId
}
private class AndroidViewHolder(context: Context) : ViewGroup(context)
kotlinCompilerExtensionVersion "0.1.0-dev07"
Mihai Popa
03/30/2020, 6:14 PMKevin Hester
03/30/2020, 6:15 PMMihai Popa
03/30/2020, 10:42 PMView
using Ref
Kevin Hester
03/31/2020, 7:22 PM