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
Android Architecture Componentの Navigationで少しは...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
bigbackboom
July 23, 2019
Technology
700
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android Architecture Componentの Navigationで少しはまった話
bigbackboom
July 23, 2019
More Decks by bigbackboom
See All by bigbackboom
Learn as a Pair
bigbackboom
0
87
Not 2 L8 JKでもわかるMaterial 3
bigbackboom
0
79
JKでもわかるSFace Recognition
bigbackboom
0
99
Androidタブレットアプリ作成_棚から牡丹餅を得るにはまず棚から
bigbackboom
0
78
Proto Datastoreを使う前の心構え
bigbackboom
0
380
Extended A Study in Bitmap: Is NDK the fast Processing method by CPU?
bigbackboom
0
52
Have A Dog in CircleCI
bigbackboom
0
120
Androidエンジニアのお仕事でのショボーン
bigbackboom
0
110
解明!楽しいプレゼンする話すスキル
bigbackboom
0
150
Other Decks in Technology
See All in Technology
並列度を下げたら速くなった — go build の重複コンパイルを実測で見る
tomoaki25
1
760
AI時代に求められる優秀なTechLeadの振る舞い
pospome
11
15k
業務でAWSをあまり使っていない私が、AWSへのモチベを保つ方法
smt7174
0
170
AIエージェントの監視、思考を見るか行動を見るか / Monitoring AI Agents: Thoughts or Actions
yusukeshimizu
2
170
続・ソフトウェアアーキテクトのための意思決定術: Decision Readiness, Revisited — When AI Changes the Economics of Software Architecture
snoozer05
PRO
9
2.7k
Building Audio Plugin Ecosystem for Android in 2026
atsushieno
2
160
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
150
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
180
bpf_arenaとstruct_opsを使うのが難しかった話
masu_mi
0
210
AI時代の組織作り:チーム開発から「個人×AI」への移行と、持続可能な「開発資本」の築き方
ham0215
2
310
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
1
7.4k
Lint の層を組み直した話
bengo4com
3
320
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
630
HDC tutorial
michielstock
2
1k
Unsuck your backbone
ammeep
672
58k
The Limits of Empathy - UXLibs8
cassininazir
2
770
Navigating Weather and Climate Data
rabernat
0
590
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
470
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
530
Crafting Experiences
bethany
1
430
Transcript
Android Architecture Componentͷ NavigationͰগ͠·ͬͨ
ࣗݾհ — ٠/bigbackboom — CBcloudגࣜձࣾɹ
Navigationͱʁ — Google I/O 2018Ͱൃද͞ΕͨAndroid Architecture ComponentͷҰͭ — FragmentؒͷભҠΛϘτϜφϏͳͲͰߦ͏ͳͲෳࡶͳཁ݅ ͷͨΊʹ։ൃ͞Εͨɻ
— backstackͷཧ͕͍͠ — fragmentࣗମͷlifecycle͕ෳࡶ — ݟͨiOSͷstoryboardͳͲʹ͍͕ۙɺ༻ൣғ͍ͩ
ͳͥϘτϜφϏͰNavigationΛ͏ඞཁ͕͋Δʁ — Α͘ΘΕ͍ͯͨɺViewPager+BottomNavigationView ׂͱ࣮͕ෳࡶʢ࡞Δύʔπ͕ଟ͍ʣɻ — ViewPagerը໘ͷΩϟογϡॲཧ͕ಈ͘ͷͰɿ — ෳը໘͕ಉ࣌ʹಡΈࠐ·Εɺىಈ͕͘ͳΔ — ΩϟογϡʹΑͬͯɺը໘͕ഁغ͞Εબ࣌ʹҰ͔
ΒಡΈࠐ·ΕΔɻ
BottomNavigationView + NavigationΛ࣮ — ͜ͷrepositoryΛϕʔεʹΘ ͤͯΒ͍·ͨ͠ɻ — ߏӈͷը૾ͷΑ͏ʹͳ͍ͬͯ ·͢ɻ
λϒຖͷঢ়ଶҡ࣋ — Կ͠ͳ͍ͱɺ DashboardFragmentͱ NotificationsFragmentλϒ͕ બ͞ΕΔͨͼʹॳظԽ͞ΕΔ — ͦΕΛආ͚ΔͨΊʹɺ BottomNavigationViewͱ FragmentͷੜΛհ͢Δɺ
FragmentNavigatorΛࣗ࡞͢Δ ඞཁ͕͋Δɻ
— ࢀߟrepositoryͰ KeepStateNavigatorͱ͍͏ͷ Λ࡞͍ͬͯΔɻ — ·ͨɺBottomNavigationViewͱ FragmentͷؔΛఆٛͨ͠ɺ nav_graph.xmlͰ KeepStateNavigatorΛ༻ͯ͠ ͍Δ
ͰɾɾɾԿʹ·ͬͨͷʁ — Activity͔ΒFragmentʹΛ͢͜ͱ͕Ͱ͖ͳ͍ɾɾɾ — ௨ৗͰ͋Ε,ԼهͷΑ͏ʹ͢ΕΛϑϥάϝϯτʹͤ Δɻ val bundle = Bundle().apply
{ putString("NOTIFICATION_KEY", "bigbacbkboom is here") } NavController.navigate(item.itemId, bundle)
͕͔ͩ͠͠ɾɾɾ
null ͩͱɾɾɾ
దʹͨΓΛ͚ͭΔ
KeepStateNavigator෦ͰσόοΨͰࢭΊͯΈΔ — Έ͚ͬͽΐΜ
KeepStateNavigator.kt ίʔυΛमਖ਼ ҎԼͷߦΛҰͭՃ͢Δ͚ͩɻ var fragment = manager.findFragmentByTag(tag) fragment?.arguments = args
if (fragment == null) { val className = destination.className fragment = manager.fragmentFactory.instantiate(context.classLoader, className) transaction.add(containerId, fragment, tag) } else { transaction.attach(fragment) }
मਖ਼༰ʁ — fragmentΛੜ͢Δͱ͖ʹɺBundleΛͯ͋͛͠ΔॲཧΛ ॻ͚͍͍ͱ͍͏ࢸۃ୯७ͳͷͰ͢ɻ — ͨͩɺਓͷίʔυΛૉʹίϐʔͯͨ͠ͷͰɺΓ͜Ε ʹؾ͕ͭ͘ͷʹۤ࿑͠·ͨ͠ɻ
݁ — NavigationViewPage+BottomNavigationViewrΑΓ ύʔπ͕গͳָ͘ɻ — ͲΜͳ͜ͱಉ͡Ͱ͕͢ɺΓͲΜͳ͜ͱͪΌΜͱཧ ղ͠ͳ͍ͱ௧͍ΛݟΔɻ
We are Hiring! — Ұॹʹಇؒ͘Λ୳͍ͯ͠·͢ɻ — αʔϏεࢤͷํ — ੵۃతʹఏҊͯ͠৽͍ٕ͠ज़ͷΤϯδχΞϦϯάΛߦ͍ͨ ͍ํ
— ϚωʔδϝϯτΛ͍ͨ͠ํ https://www.wantedly.com/companies/cb-cloud