Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
UIの構成要素に関する考察
Search
mikan
May 10, 2024
Technology
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
UIの構成要素に関する考察
モバイル開発LTナイト 〜アプリ開発者交流会〜 の発表資料です
https://karabiner.connpass.com/event/316762/
mikan
May 10, 2024
More Decks by mikan
See All by mikan
Navigation3でやりとりした画面引数をSavedStateHandleから引き出せない理由
mikanichinose
0
30
Lazy APIを使ってGradleビルド速度を改善する
mikanichinose
1
89
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
730
「脳に収まるコードの書き方」を読んで学んだこと
mikanichinose
1
240
RepositoryのSSoT化
mikanichinose
0
99
Kotlin Multiplatform 始めました
mikanichinose
1
160
Web APIをなぜつくるのか
mikanichinose
0
4.3k
イベントをどう管理するか
mikanichinose
3
420
ライブラリでしかお目にかかれない珍しい実装
mikanichinose
2
520
Other Decks in Technology
See All in Technology
2026/09/10 Spring_Bootから_Jakarta_EE_MicroProfileへの移行
megascus
0
270
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
0
1.2k
2026-09-04 SRE Tech Talk #15 怠惰なTerraform / Lazy Terraform
masasuzu
0
230
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
130
Bet AI Day 2026丨Production-Ready AI Agents — エンタープライズの実務を任せるための設計と運用
layerx
PRO
4
2.7k
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
450
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
130
Tab5をRubyで動くパソコンにする
kishima
2
280
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
130
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
580
DEFCON34-Write-up_HYCu-MYCu
daikiokazaki
0
120
推論の観測、できていますか? 〜 Google Cloud Gemini Enterprise Agent Platformで 3つの Gemini モデルを実測して踏んだ、評価の罠 〜
shukob
PRO
0
180
Featured
See All Featured
Believing is Seeing
oripsolob
1
210
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
Embracing the Ebb and Flow
colly
88
5.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
The Limits of Empathy - UXLibs8
cassininazir
1
640
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Statistics for Hackers
jakevdp
799
230k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
230
Transcript
UI の構成要素に関する考察 モバイル開発LT ナイト 〜アプリ開発者交流会〜 mikan( 一瀬喜弘)
自己紹介 object Mikan { val name = " 一瀬喜弘" val
company = "karabiner.tech" val work = Engineer.Android val hobby = listOf( " 漫画", " アニメ", " ゲーム", " 折り紙", "OSS 開発・コントリビュート", ) }
Compose で大きめの画面のUI を 組んだときのつらみ
Composable 関数のパラメータ 多すぎ
@Composable fun HomeScreen( aSectionUiModel: ASectionUiModel, onClickAItem: (itemId: String) -> Unit,
onClickHelp: () -> Unit, bSectionUiModel: BSectionUiModel, onClickBItem: (itemId: String) -> Unit, onClickMoreButton: () -> Unit, cSectionUiModel: CSectionUiModel, onClickBItem: (itemId: String) -> Unit, dSectionUiModel: DSectionUiModel, onClickDItem: (itemId: String) -> Unit, eSectionUiModel: ESectionUiModel, ) { /* ... */ }
ラムダ式の区別がつかない
onClickHelp: () -> Unit, onClickMoreButton: () -> Unit, @Composable fun
HomeScreen( aSectionUiModel: ASectionUiModel, onClickAItem: (itemId: String) -> Unit, bSectionUiModel: BSectionUiModel, onClickBItem: (itemId: String) -> Unit, cSectionUiModel: CSectionUiModel, onClickBItem: (itemId: String) -> Unit, dSectionUiModel: DSectionUiModel, onClickDItem: (itemId: String) -> Unit, eSectionUiModel: ESectionUiModel, ) { /* ... */ }
理想 UiState やイベントハンドラーは1 本化されて高凝集な状態 @Composable fun HomeScreen( uiModel: HomeUiModel, onUiEvent:
(UiEvent) -> Unit, ) { /* ... */ }
闇雲に実装しても沼にはまるの でUI の作りを見直す
None
None
None
UI は大きく分けて2 つのものを もっているのではないか
状態 と イベント
状態 画面を構成する動的な情報を含んだデータホルダー 任意の時刻における状態を取得することができる 連続的
イベント ユーザーインタラクションやエラー等を表現したもの 特定の時刻に特定のイベントが発行される 離散的
スクリーンレベルとUI レベル
スクリーンレベルの状態 ローディング 成功 エラー スクリーンレベルのイベント エラー 画面遷移
UI レベルの状態 UI レベルのイベント ユーザーインタラクション
UI レベルの状態とイベントは階 層構造を持つ → 今回は割愛
どう実装に落とし込むのか データホルダーとしてStateFlow( 状態) とSharedFlow( イベント) をもちいる イベントの合成だったり、イベントをもとに新しいイベントを発行したり、非同期処理を実行したり、状態を 更新したり → FRP
だったりTEA(The Elm Architecture) 、圏論等の関数型プログラミングの知見をつかう