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
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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
UIの構成要素に関する考察
Search
mikan
May 10, 2024
Technology
110
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
Loop Engineering これくらいでいい
mikanichinose
0
260
形式手法を使って仕様をコーディングしよう
mikanichinose
0
200
Navigation3でやりとりした画面引数をSavedStateHandleから引き出せない理由
mikanichinose
0
41
Lazy APIを使ってGradleビルド速度を改善する
mikanichinose
1
94
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
770
「脳に収まるコードの書き方」を読んで学んだこと
mikanichinose
1
240
RepositoryのSSoT化
mikanichinose
0
110
Kotlin Multiplatform 始めました
mikanichinose
1
170
Web APIをなぜつくるのか
mikanichinose
0
4.4k
Other Decks in Technology
See All in Technology
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
320
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
200
僕のハーネスを紹介します
watany
3
670
CloudWatch Logsのコスト最適化:どこまでAIに任せてどこから人間が承認すべきか
yama3133
0
120
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
350
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
360
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
740
sue445's proposals 2026
sue445
0
110
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
290
Optunaの最新リリースv5.0について
pfn
PRO
0
120
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
夫婦で子育てするための育児標準化
codmoninc
PRO
0
470
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Navigating Weather and Climate Data
rabernat
0
560
Facilitating Awesome Meetings
lara
57
7.2k
Rails Girls Zürich Keynote
gr2m
96
14k
How to Ace a Technical Interview
jacobian
280
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fireside Chat
paigeccino
43
4.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
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) 、圏論等の関数型プログラミングの知見をつかう