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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mikan
May 10, 2024
Technology
120
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
Transcript
21 slides
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) 、圏論等の関数型プログラミングの知見をつかう
More Decks by mikan
See All by mikan
Loop Engineering これくらいでいい
mikanichinose
0
320
形式手法を使って仕様をコーディングしよう
mikanichinose
0
260
Navigation3でやりとりした画面引数をSavedStateHandleから引き出せない理由
mikanichinose
0
44
Lazy APIを使ってGradleビルド速度を改善する
mikanichinose
1
150
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
780
「脳に収まるコードの書き方」を読んで学んだこと
mikanichinose
1
250
RepositoryのSSoT化
mikanichinose
0
110
Kotlin Multiplatform 始めました
mikanichinose
1
180
Web APIをなぜつくるのか
mikanichinose
0
4.4k
Other Decks in Technology
See All in Technology
複数システムが同居した 15 年物の AWS アカウントを解体するための考古学
wa6sn
3
150
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
0
230
AIが会計業務の伴走者に。 マネーフォワード クラウド会計MCPサーバーで実現するAI前提の新しい業務プロセス
nobitabashi
0
140
AWS Emulator を評価する: 手元で動く AWS の API の仕組み、始め方、確かめ方
inariku
PRO
1
580
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
200
マネージャーをエスパーにしない マネジメントされる側から始める、働きやすい現場づくり
comi190327
0
410
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
340
20261113_JAWS_Osaka
takuyay0ne
0
480
思考過程から秘密が漏れる:Amazon Bedrock上のKimi K3を5つの方法で攻めたら、25回中22回漏洩した話
yama3133
1
160
Claude Codeで作ったアプリを安全に公開する/Built with Claude Japan 2026
yoshidashingo
0
250
Go初心者のクラウドエンジニアが、デプロイを通して旨味を知っていく話
ryudai
1
210
Kiro アップデート 2026 年 11 月号 (11 月 8 日時点) | 目指せ Kiro マスター アップデート編
inariku
PRO
2
120
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
980
GitHub's CSS Performance
jonrohan
1033
470k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
520
Crafting Experiences
bethany
1
440
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Paper Plane
katiecoart
PRO
6
55k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
300