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

アジェンダ段階 Compose for Deskopで始めるAndroid開発効率化ツールの作成

Yusuke Katsuragawa
September 09, 2022
150

アジェンダ段階 Compose for Deskopで始めるAndroid開発効率化ツールの作成

Yusuke Katsuragawa

September 09, 2022
Tweet

Transcript

  1. @Composable fun CommandItem ( title: String, detail: String, onExecute :

    () -> Unit, modifier : Modifier = Modifier ) { Card(modifier ) { Row( horizontalArrangement = Arrangement .spacedBy (8.dp), verticalAlignment = Alignment .CenterVertically , modifier = Modifier .padding(8.dp) ) { Column(modifier = Modifier .weight(0.9f, true)) { Text(text = title) Text(text = detail) } Button(onClick = { onExecute () }) { Text(text = Strings.EXECUTE) } } } } @Preview @Composable private fun CommandItem_Preview () { CommandItem( title = "ダークテーマ ON", detail = "端末のダークテーマ設定を ONにします", onExecute = {}, modifier = Modifier .fillMaxWidth().wrapContentWidth() ) } コマンド実行 - View層①
  2. @Composable fun CommandItem ( title: String, detail: String, onExecute :

    () -> Unit, modifier : Modifier = Modifier ) { Card(modifier ) { Row( horizontalArrangement = Arrangement .spacedBy (8.dp), verticalAlignment = Alignment .CenterVertically , modifier = Modifier .padding(8.dp) ) { Column(modifier = Modifier .weight(0.9f, true)) { Text(text = title) Text(text = detail) } Button(onClick = { onExecute () }) { Text(text = Strings.EXECUTE) } } } } @Preview @Composable private fun CommandItem_Preview () { CommandItem( title = "ダークテーマ ON", detail = "端末のダークテーマ設定を ONにします", onExecute = {}, modifier = Modifier .fillMaxWidth().wrapContentWidth() ) } コマンド実行 - StateHolder①
  3. @Composable fun CommandItem ( title: String, detail: String, onExecute :

    () -> Unit, modifier : Modifier = Modifier ) { Card(modifier ) { Row( horizontalArrangement = Arrangement .spacedBy (8.dp), verticalAlignment = Alignment .CenterVertically , modifier = Modifier .padding(8.dp) ) { Column(modifier = Modifier .weight(0.9f, true)) { Text(text = title) Text(text = detail) } Button(onClick = { onExecute () }) { Text(text = Strings.EXECUTE) } } } } @Preview @Composable private fun CommandItem_Preview () { CommandItem( title = "ダークテーマ ON", detail = "端末のダークテーマ設定を ONにします", onExecute = {}, modifier = Modifier .fillMaxWidth().wrapContentWidth() ) } コマンド実行 - Model①