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
53
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
750
Build apps for Cars
keithyokoma
0
590
Save the state
keithyokoma
0
630
Either in Kotlin
keithyokoma
0
640
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
5.6k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
5.3k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
590
DX Improvements
keithyokoma
3
450
Other Decks in Technology
See All in Technology
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
960
現場のトークンマネジメント
dak2
1
200
起点・思考・出力で分解する 〜PM業務の自動化設計〜
kazu_kichi_67
2
1.1k
はてなのサービス基盤を支える Kubernetes《足腰》
masayoshimaezawa
0
180
「軸足」は 固定しなくていい - 熱量と強みで描く、しなやかなキャリアの形
kakehashi
PRO
1
280
FPGAの開発コンペでZephyrを使ってみた
iotengineer22
0
220
UIパーツの設計を「型」から読み解く 〜TSKaigiのセッションから得た学び〜
yud0uhu
0
110
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
300
toB プロダクトから見たWAF
tokai235
0
250
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
1
900
組織における AI-DLC 実践
askul
0
160
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Leo the Paperboy
mayatellez
7
1.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
870
Six Lessons from altMBA
skipperchong
29
4.3k
The Language of Interfaces
destraynor
162
27k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
220
Raft: Consensus for Rubyists
vanstee
141
7.6k
Believing is Seeing
oripsolob
1
150
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
200
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.