I am using a `BottomSheetDialogFragment` and it’s ...
# compose
d
I am using a
BottomSheetDialogFragment
and it’s layout has a
ComposeView
in it. When trying to show the sheet I get this:
java.lang.IllegalStateException: ViewTreeLifecycleOwner not found
after the framework calls:
androidx.compose.ui.platform.WindowRecomposer_androidKt.createLifecycleAwareViewTreeRecomposer(WindowRecomposer.android.kt:244)
Anybody run into this before?
a
Make sure you're using the latest versions of the fragment and androidx.activity libraries
(at least latest stable; betas/alphas are up to you)
i
FWIW, it was Fragment 1.3.1 that set the appropriate ViewTree owners for dialogs: https://developer.android.com/jetpack/androidx/releases/fragment#1.3.1
d
Ok, thanks, I am adding `
Copy code
implementation "androidx.fragment:fragment-ktx:1.4.0"
and see what happens.
Yeah that works!
🎉 2
@Ian Lake Any idea how to get a smooth opening animation? Like a slide up from the bottom?
i
I'd file a bug against Material Design Components (https://github.com/material-components/material-components-android) if you aren't seeing a smooth opening animation as they are the owners for
BottomSheetDialogFragment
a
also make sure you're doing any performance analysis on a release build run through r8
d
Will do, thanks so much guys! I am very grateful.
👍 1