Luis Mierez
05/11/2021, 9:49 PMLuis Mierez
05/11/2021, 9:49 PMLuis Mierez
05/11/2021, 9:51 PMLuis Mierez
05/11/2021, 9:57 PMComposeView in the xmlIan Lake
05/11/2021, 9:58 PMAppCompatActivity, make sure you're using AppCompat 1.3.0-rc01 - only the 1.3 versions set the ViewTreeLifecycleOwner that ComposeView requiresLuis Mierez
05/11/2021, 10:00 PMLouis Pullen-Freilich [G]
05/11/2021, 10:02 PMComposeView / how are you calling setContent on it?Ian Lake
05/11/2021, 10:04 PMsetContent on your ComposeView at all?)Luis Mierez
05/11/2021, 10:04 PMComposeView I’m just adding in the xml, and then in Fragment I’m calling the setContent which passing in my composable functionLuis Mierez
05/11/2021, 10:05 PM<androidx.compose.ui.platform.ComposeView
android:id="@+id/user_section_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>Luis Mierez
05/11/2021, 10:05 PMupdateInfoComposeView.setContent {
UserInfoSection()
}Luis Mierez
05/11/2021, 10:06 PMLouis Pullen-Freilich [G]
05/11/2021, 10:07 PMFragment are you calling setContent ?Luis Mierez
05/11/2021, 10:07 PMonViewCreatedIan Lake
05/11/2021, 10:08 PMComposeView will have gone through onAttachedToWindow by that pointLuis Mierez
05/11/2021, 10:09 PMIan Lake
05/11/2021, 10:09 PMIan Lake
05/11/2021, 10:09 PMLuis Mierez
05/11/2021, 10:10 PMIan Lake
05/11/2021, 10:10 PMComposeView could avoid throwing in onAttachedToWindow and instead wait for you call setContent for the first time? Then you'd get the good error messageLouis Pullen-Freilich [G]
05/11/2021, 10:12 PMComposeView shouldn’t create anything until is setContent is called, no? Only AbstractComposeView allows for extra choices in terms of when to set up the compositionLuis Mierez
05/11/2021, 10:17 PMLuis Mierez
05/11/2021, 10:18 PMIan Lake
05/11/2021, 10:18 PMLuis Mierez
05/11/2021, 10:19 PMLouis Pullen-Freilich [G]
05/11/2021, 10:19 PMLuis Mierez
05/11/2021, 10:21 PMLuis Mierez
05/11/2021, 10:22 PM