YUNOVA · Android Development
Module 11: Advanced Jetpack Compose
State hoisting and recomposition
Key points
- State hoisting moves state up to the caller and passes value and event down.
- Compose recomposes only the composables that read state that changed.
- remember keeps a value across recompositions; rememberSaveable also survives rotation.
Animations in Jetpack Compose
Key points
- animate*AsState animates a single value when its target changes.
- AnimatedVisibility animates a composable appearing and disappearing.
- updateTransition coordinates several animated values around one state.
Custom layouts and Canvas in Compose
Key points
- The Layout composable measures children and places them yourself.
- Canvas gives a DrawScope to draw lines, shapes, arcs and text.
- Modifier.drawBehind draws custom graphics behind existing content.
Navigation Compose with arguments
Key points
- A NavHost maps routes to composable screens.
- Arguments are passed in the route and read from the back stack entry.
- Pass IDs between screens, not large objects; load the data on the next screen.