-
Notifications
You must be signed in to change notification settings - Fork 205
Compose
qiibeta edited this page Aug 16, 2024
·
2 revisions
To use Compose in a Scene, return a ComposeView in the onCreateView() lifecycle method of your Scene. ComposeView has a setContent() method where you can provide a composable function.
class NewFeatureScene : Scene() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup,
savedInstanceState: Bundle?
): View {
return ComposeView(requireSceneContext()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
NewFeatureScreen()
}
}
}
}
- Home
- Background
- Installation
- Basic
- NavigationScene
- GroupScene
- Navigation Animation
- Dialog
- Router
- Style
- State Save
- Architecture-Patterns
- Activity Compatibility
- Migrate Guide
- Benchmark (compare to Activity/Fragment)