Maybe an "dumb" question, but is it possible to em...
# compose
t
Maybe an "dumb" question, but is it possible to embed a fragment in Jetpack compose (So not Jetpack compose inside a fragment)?
j
Not that I know of: Compose interop is with the
View
class, (and viceversa) not with
Fragment
class.
Warning: Due to issues with fragments, it's recommended to avoid embedding fragments inside the 
AndroidView
 composable. Follow this issue here.
j
So after https://issuetracker.google.com/issues/179915946 is fixed it will be possible to put a
FragmentContainerView
inside an
AndroidView
composable? 🥶
t
Ah, thx!
i
If you copy/paste the workaround code in that or wait for the 3 in flight PRs to land and that issue marked as fixed, using
AndroidViewBinding
with a layout that inflates a
FragmentContainerView
with a fragment will work just fine in a compose hierarchy
I'd use it more of as a transitional step and not as a final, suggested architecture though 🙂
😄 1
FWIW, all of the fixes got checked in today, so they should be available in the next Compose beta
🎉 2