UI A quick recall to compose 03 XML to Compose Migration 04 State Handling Explore state handling in compose with a Spinner example 05 Reusable Component 06 Best practices for Compose 07 Questions & Answer Questions on anything “Android”
Architecture Components 03 Easier State Management 04 Cuts down development time 05 Tooling Support by Android Studio 06 A rapidly growing Community Advantages
• Focuses on “HOW” of UI presentation • ဘယ်ေန ့ မှ ေဆာင်မှာလဲ xD Imperative UI • We describe, or declare, what UI should look like • Focuses on “What” of UI Presentation Declarative UI
…, shapes = … ) { // app content } MDC Compose Theme Adapter goo.gle/mdc-compose-theme-adapter • Use MDC theme as single source of truth • Read the color, text appearance and shape appearance from your MDC theme -> Compose
Int = DEFAULT_PARAM_2, callBack: () -> Unit = {} ): CalendarState = remember { CustomCalendarState(parameter1, parameter2, callBack) } private class CustomCalendarState( val parameter1: String, val parameter2: Int, val callBack: () -> Unit ) : CalendarState
dimensions 03 Reuse as much as possible 04 Use helper classes 05 Use Effect Handler Top 5 best practices for Compose 06 Avoid as much recomposition as possible 07 Use keys argument for LazyLists for better performance
effect • LaunchedEffect Run suspend functions in the scope of composable • DisposableEffect Effect that require cleanup • SideEffect Publish Compose state to non-compose code • produceState Convert non-compose state into Compose state • derivedStateof Convert one or multiple state objects into another state • snapshotFlow Convert Compose’s state into Flows