Slide 1

Slide 1 text

Wear OSΞϓϦ։ൃTips with Jetpack Compose 2022.06.14 ਆݪ ݈Ұ (@korodroid) Engineer LT #1

Slide 2

Slide 2 text

2 About me ਆݪ ݈Ұ (@korodroid) •Mobile App Development •Speeches (e.g. 9 International confs.) •Writings (e.g. 6 Dev Books) •[Of fi cial] Evangelist at NTT TechnoCross •[Private] iplatform.org

Slide 3

Slide 3 text

Agenda •Wear OS ͷ࠷৽τϐοΫ(։ൃऀ޲͚) •Wear OS ΞϓϦ։ൃTips with Jetpack Compose Source: Google I/O 2022 Keynote / Developer Keynote / Wear OS Session Android Developers Blog

Slide 4

Slide 4 text

Wear OS Topics from I/O 2022 (։ൃऀ޲͚:ൈਮ) 

Slide 5

Slide 5 text

Compose for Wear OS Input components Dialogs Page Indicator Progress Indicator  Navigation

Slide 6

Slide 6 text

Compose for Wear OS ࣮૷ྫ(͋ͱͰվળ͍͖ͯ͠·͢) @Composable fun ContactsScreenV1() { LazyColumn { item { ListHeader { Text(text = "Contacts") } } items(20) { Chip( icon = { Icon( Icons.Rounded.Face, contentDescription = "Contacts", ) }, label = { Text("HogeHoge Tarou $it") }, colors = ChipDefaults.primaryChipColors(), onClick = { }, ) } } } 

Slide 7

Slide 7 text

7 Wear OS ΞϓϦ։ൃTips with Jetpack Compose

Slide 8

Slide 8 text

8 ։ൃ؀ڥ  IntelʹՃ͑ɺApple Silicon΋αϙʔτ Wear OS ։ൃʹ͓͢͢Ί

Slide 9

Slide 9 text

9 Wear OS ϓϩδΣΫτ࡞੒  Jetpack ComposeͰ։ൃ͢Δ৔߹

Slide 10

Slide 10 text

10 Live Demo💪 

Slide 11

Slide 11 text

Tips1: Live Editͷઃఆ(Electric Eel) 

Slide 12

Slide 12 text

Tips2: ϓϨϏϡʔػೳ(Electric Eel) 

Slide 13

Slide 13 text

[UIվળͷલʹ…]Wear OSͱMobileͷҧ͍(ྫ)  Wear OS 
 (androidx.wear.*) Mobile 
 (androidx.*) androidx.wear.compose:compose-material androidx.wear.compose:compose-navigation androidx.compose.foundation:foundation androidx.wear.compose:compose-foundation androidx.compose.material:material androidx.navigation:navigation-compose androidx.compose.foundation:foundation ref: https://developer.android.com/training/wearables/compose

Slide 14

Slide 14 text

@Composable fun ContactsScreenV2() { ScalingLazyColumn { item { ListHeader { Text(text = "Contacts") } } items(20) { Chip( icon = { Icon( Icons.Rounded.Face, contentDescription = "Contacts", ) }, label = { Text("HogeHoge Tarou $it") }, colors = ChipDefaults.primaryChipColors(), onClick = { }, ) } } }  Tips3: UIվળྫ1(ScalingLazyColumn΁ͷஔ͖׵͑)

Slide 15

Slide 15 text

@OptIn(ExperimentalWearMaterialApi::class) @Composable fun ContactsScreenV3() { val listState = rememberScalingLazyListState() Scaffold( timeText = { if (!listState.isScrollInProgress) { TimeText() } }, vignette = { Vignette( vignettePosition = VignettePosition.TopAndBottom ) }, positionIndicator = { PositionIndicator( scalingLazyListState = listState, ) } ) { ScalingLazyColumn(state = listState) { // লུ } }  Tips4: UIվળྫ2(Scaffoldͷ׆༻)

Slide 16

Slide 16 text

Reference  •Google I/O 2022 Keynote / Developer Keynote / Session 
 https://io.google/2022 
 •Announcing Compose for Wear OS Beta! 
 https://android-developers.googleblog.com/2022/05/ announcing-compose-for-wear-os-beta.html •Codelabs (Wear OS) 
 https://codelabs.developers.google.com/?cat=wearos

Slide 17

Slide 17 text

Please let me know if you have any requests 
 such as technical speeches, technical writings and so on. http://www.linkedin.com/in/korodroid Thank you so much http://fb.com/kanbara.kenichi @korodroid