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
One screen, many BottomSheets
Search
Keishin Yokomaku
June 14, 2024
Technology
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
One screen, many BottomSheets
Keishin Yokomaku
June 14, 2024
More Decks by Keishin Yokomaku
See All by Keishin Yokomaku
Base64 in Android
keithyokoma
0
55
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
760
Build apps for Cars
keithyokoma
0
590
Save the state
keithyokoma
0
630
Either in Kotlin
keithyokoma
0
650
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
5.6k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
5.4k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
590
DX Improvements
keithyokoma
3
460
Other Decks in Technology
See All in Technology
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
520
20260724 情シスAI #1 「全従業員をAIネイティブにする」ために情シスがやっていること(公開版)
frtckty
0
150
20260801_スクフェス大阪
kgnkhkr
0
330
[しろおび夏祭り2026] チャットするAIから、作業するAIへ - 使われ方の変化と、その裏側で起きていること
kk0n
0
730
コンポーネント名には何を含めるべきなのか? / what-should-be-included-in-component-names
airrnot1106
0
230
MCPをつなげて作る組織横断のAIエージェント基盤
tsubakimoto_s
0
530
Claude Mythos、Fable...フロンティアAIの最新動向と企業のセキュリティ対策
flatt_security
0
180
QAタスクをスキル化したいときに考えること
aomoriringo
0
140
テックカンファレンス三大ステークホルダーの文化人類学 ─ 違いを認め合う関係性作り
bash0c7
5
1.5k
AI研修(Day1)【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
3.2k
『モンスターストライク』 の運営に伴走する! データ民主化への 解析グループの3つのアプローチ
mixi_engineers
PRO
0
200
ウォーターフォール開発案件のPMとしてAI活用を模索している話
hatahata021
3
250
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Google's AI Overviews - The New Search
badams
0
1.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
New Earth Scene 8
popppiees
3
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
450
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Transcript
One screen, many BottomSheets Keishin Yokomaku(@KeithYokoma) / Drivemode, Inc.
One screen, many BottomSheets About me ▸ Keishin Yokomaku -
@KeithYokoma ▸ GitHub / Twitter / Stack Over fl ow ▸ Drivemode, Inc. / Engineer
▸ e.g. X (چ Twitter) ▸ ԡ͢Ϙλϯ͝ͱʹҧ͏ BottomSheet ͕ग़Δ One
screen, many BottomSheets Ұͭͷը໘ʹෳछྨͷ BottomSheet Λग़͍ͨ͠
One screen, many BottomSheets ߟ͑ΒΕΔ࣮ ▸ ͦΕͧΕͷ BottomSheet Λ… ▸
BottomSheetDialogFragment Ͱ࡞Δ ▸ BottomSheetScaffold ͷ sheetContent Ͱग़͚͠Δ
One screen, many BottomSheets BottomSheetDialogFragment Ͱ࡞Δ ▸ UI ͷछྨ͝ͱʹ Fragment
Λ͚Δ BottomSheetDialogFragment BottomSheetDialogFragment BottomSheetDialogFragment
One screen, many BottomSheets BottomSheetDialogFragment Ͱ࡞Δ class FooBottomSheetFragment : BottomSheetDialogFragment()
{ override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View = ComposeView(requireContext()).apply { setContent { BottomsheetTheme { FooSheetContent() } } } @Composable fun FooSheetContent() {} }
One screen, many BottomSheets BottomSheetDialogFragment Ͱ࡞Δ ▸ BottomSheetDialogFragment ͷ UI
▸ Compose Ͱ࡞ΕΔ ▸ දࣔɾඇදࣔʹ͢Δ෦͚ͩ DialogFragment ͷ API ʹै͏ ▸ BottomSheet ্Ͱͷ UI ΠϕϯτͷϋϯυϦϯά ▸ DialogFragment ͰΑ͋͘ΔίʔϧόοΫͷ࣮ํ๏Ͳ͏͢Δ͔ ▸ BottomSheetDialogFragment Λϗετ͍ͯ͠Δը໘ͱಉ͡ ViewModel Λ ೖͰ͖ΔͳΒίʔϧόοΫΛఆٛ͠ͳ͍͍ͯ͘
One screen, many BottomSheets BottomSheetDialogFragment Ͱ࡞Δ: ViewModel class MainActivity :
AppCompatActivity() { private val viewModel: MyViewModel by viewModels() } class FooBottomSheetFragment : BottomSheetDialogFragment() { private val viewModel: MyViewModel by activityViewModels() } class MyViewModel : ViewModel() {}
One screen, many BottomSheets BottomSheetScaffold ͷ sheetContent Ͱग़͚͠Δ ▸ UI
ͷछྨ͝ͱʹ Composable Λ͚Δ RepostSheetContent() PostMenuSheetContent() ShareSheetContent()
One screen, many BottomSheets BottomSheetScaffold ͷ sheetContent Ͱग़͚͠Δ BottomSheetScaffold( sheetContent
= { when (sheetType) { BottomSheetType.FOO -> { Text(text = "Hello FOO") } BottomSheetType.BAR -> { Text(text = "Hello BAR") } BottomSheetType.BAZ -> { Text(text = "Hello BAZ") } BottomSheetType.NONE -> {} } } ) enum class BottomSheetType { FOO, BAR, BAZ, NONE }
One screen, many BottomSheets BottomSheetScaffold ͷ sheetContent Ͱग़͚͠Δ ▸ Ͳ͏ͯ͠ذ͕૿͑Δ
▸ sheetContent ͕Ұ͔ͭ͠ͳ͍ͷͰ͜ͷதͰදࣔΛ͚Δ
One screen, many BottomSheets BottomSheetScaffold ͷ sheetContent Ͱग़͚͠Δ ▸ BottomSheet
ͷ UI ͕ΞϓϦͷ༷ͱ߹Θͳ͍Մೳੑ ▸ BottomNavigationView + Fragment Ͱը໘Λߏͨ͠ͱ͖ ▸ Fragment ͷதʹ BottomSheetScaffold ͕͋Δ ▸ Fragment ͕࣋ͭ Boundary Ͱܭࢉ͢ΔͷͰ BottomSheet ͕ BottomNavigationView ͷ্͔Βग़ͯ͘Δ
One screen, many BottomSheets ͲͪΒ͕Α͍͔ ▸ It depends ▸ ཁ݅ΞϓϦͷ
UI ͷߏ࣍ୈ ▸ શ෦ Compose ͳΒ BottomSheetDialogFragment Θͳͯ͘ྑ͍
One screen, many BottomSheets Keishin Yokomaku(@KeithYokoma) / Drivemode, Inc.