Skip to content

Instantly share code, notes, and snippets.

@akitikkx
Last active March 16, 2022 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akitikkx/b3ff0e8f17ec3d1ca3680a3e6208b2bf to your computer and use it in GitHub Desktop.
Save akitikkx/b3ff0e8f17ec3d1ca3680a3e6208b2bf to your computer and use it in GitHub Desktop.
override fun onCreateView(...): View {
...
binding.composeContainer.apply {
// Dispose of the Composition when the view's
// LifecycleOwner is destroyed
// https://developer.android.com/jetpack/compose/interop/interop-apis
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
MdcTheme {
ShowDetailScreen(
onSeasonsClick = {
viewModel.onSeasonsClick()
}
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment