Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UIの構成要素に関する考察
Search
mikan
May 10, 2024
Technology
99
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
Lazy APIを使ってGradleビルド速度を改善する
mikanichinose
1
75
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
700
「脳に収まるコードの書き方」を読んで学んだこと
mikanichinose
1
220
RepositoryのSSoT化
mikanichinose
0
93
Kotlin Multiplatform 始めました
mikanichinose
1
150
Web APIをなぜつくるのか
mikanichinose
0
3.9k
イベントをどう管理するか
mikanichinose
3
410
ライブラリでしかお目にかかれない珍しい実装
mikanichinose
2
510
Strong Skipping Mode によってrecompositionはどう変わったのか
mikanichinose
0
410
Other Decks in Technology
See All in Technology
MySQL & MySQL HeatWave Report - June 2026
freshdaz
0
310
デジタル・デザイン:次の50年を描く「進化する青写真」
y150saya
0
810
型は壁、Rustでもバグを直すな、表現できなくせよ
nwiizo
9
1k
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
390
Tech-Verse 2026_Keynote
lycorptech_jp
PRO
0
130
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
180
組織における AI-DLC 実践
askul
0
310
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
120
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
130
5分でわかる Amazon Connect_20260608
hwangbyeonghun
0
180
なぜ私たちのSREプラクティスはなかなか機能しないのか 〜システムより先に組織を見る〜 / Why our SRE practices aren't really working
vtryo
0
670
AIに「使われる」時代のSaaS戦略 〜既存WebAPIのMCPサーバー化における開発ノウハウ〜
ekispert_api
0
290
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
180
Ethics towards AI in product and experience design
skipperchong
2
320
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
Automating Front-end Workflow
addyosmani
1370
210k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Prompt Engineering for Job Search
mfonobong
0
370
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
500
Optimising Largest Contentful Paint
csswizardry
37
3.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
960
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
380
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
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) 、圏論等の関数型プログラミングの知見をつかう