Upgrade to Pro — share decks privately, control downloads, hide ads and more …

chocoZAPアプリのMultipreview annotations

chocoZAPアプリのMultipreview annotations

■ イベント
2024年11月13日開催
KINTOテクノロジーズ×RIZAPテクノロジーズ Mobile Tips
https://rizap.connpass.com/event/334440/

■ 発表者
chocoZAP Androidエンジニア
藤井 賢太郎

RIZAPテクノロジーズ

January 28, 2025
Tweet

More Decks by RIZAPテクノロジーズ

Other Decks in Programming

Transcript

  1. アジェンダ • 自己紹介 • Multipreview annotations とは • Multipreview annotations

    の表示確認 • chocoZAPアプリの Multipreview annotations • まとめ
  2. @OptIn(ExperimentalMaterial3Api::class) @Composable fun SampleScreen() { Scaffold( topBar = { TopAppBar(

    title = { Text(text = "サンプル画面") } ) } ) { Box( modifier = Modifier .fillMaxSize() .padding(it) ) { Column( modifier = Modifier .fillMaxSize() .padding( start = 16.dp, end = 16.dp, bottom = 16.dp, ), verticalArrangement = Arrangement.spacedBy( space = 16.dp, alignment = Alignment.CenterVertically, ), ) { Text( text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") } } } } }
  3. @OptIn(ExperimentalMaterial3Api::class) @Composable fun SampleScreen() { Scaffold( topBar = { TopAppBar(

    title = { Text(text = "サンプル画面") } ) } ) { Box( modifier = Modifier .fillMaxSize() .padding(it) ) { Column( modifier = Modifier .fillMaxSize() .padding( start = 16.dp, end = 16.dp, bottom = 16.dp, ), verticalArrangement = Arrangement.spacedBy( space = 16.dp, alignment = Alignment.CenterVertically, ), ) { Text( text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") } } } } }
  4. TopAppBar( title = { Text(text = "サンプル画面") } ) Text(

    text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") }
  5. TopAppBar( title = { Text(text = "サンプル画面") } ) Text(

    text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") }
  6. TopAppBar( title = { Text(text = "サンプル画面") } ) Text(

    text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") }
  7. TopAppBar( title = { Text(text = "サンプル画面") } ) Text(

    text = "SampleSampleSampleSampleSampleSample", maxLines = 1, overflow = TextOverflow.Ellipsis, ) Button( onClick = {}, modifier = Modifier.fillMaxWidth(), ) { Text(text = "ボタン") }
  8. @Preview( name = "04. 普通端末 横表示 フォント100%", group = "普通端末",

    device = "spec:parent=pixel_8,orientation=landscape", fontScale = 1f, )
  9. @Preview( name = "01. 普通端末 縦表示 フォント85%", group = "普通端末",

    device = "spec:parent=pixel_8", fontScale = 0.85f, ) @Preview( name = "02. 普通端末 縦表示 フォント100%", group = "普通端末", device = "spec:parent=pixel_8", fontScale = 1f, ) @Preview( name = "03. 普通端末 縦表示 フォント200%", group = "普通端末", device = "spec:parent=pixel_8", fontScale = 2f, ) @Preview( name = "04. 普通端末 横表示 フォント100%", group = "普通端末", device = "spec:parent=pixel_8,orientation=landscape", fontScale = 1f, ) @Preview( name = "10. 小さい端末 縦表示 フォント100%", group = "小さい端末", device = "id:small_phone", fontScale = 1f, ) @Preview( name = "11. 小さい端末 縦表示 フォント200%", group = "小さい端末", device = "id:small_phone", fontScale = 2f, ) @Preview( name = "20. Foldable端末 縦表示 フォント100%", group = "Foldable端末", device = "spec:parent=pixel_fold", fontScale = 1f, ) annotation class ChocoZapPreviews