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
Navigation x Deep Link 結構大変だった話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
KKusumi
November 27, 2019
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Navigation x Deep Link 結構大変だった話
KKusumi
November 27, 2019
More Decks by KKusumi
See All by KKusumi
今日から始めるAndroid Unit Test
kkusumi
0
160
Other Decks in Programming
See All in Programming
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
190
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
アクセシビリティから考える情報設計
high_g_engineer
0
350
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
490
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
130
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
520
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
280
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
360
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Evolving SEO for Evolving Search Engines
ryanjones
0
280
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
690
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
420
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Raft: Consensus for Rubyists
vanstee
141
7.7k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Abbi's Birthday
coloredviolet
3
9.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Transcript
Katsumi Kusumi @ and factory.inc 1 Navigation x DeepLink ݁ߏେมͩͬͨ
About Me 2 • Katsumi Kusumi(@kl_tech) • and factory •
Android App Engineer • ອըΞϓϦ࡞ͬͯ·͢ɻ
3 ࢲ͝ͱͰ͕͢ɺɺɺ
4 ͔͜͜Βຊ
ࠓ͔Β׆͔ͤΔ Jetpack Navigation࣮ํ๏ 5
What is Jetpack Navigation?? 6
Navigationͱ 7 By Android developers documentation • φϏήʔγϣϯͱɺϢʔβʔ͕ΞϓϦͷ༷ʑͳίϯςϯπؒΛҠಈ͢Δૢ࡞ Λࢦ͠·͢ɻ •
Android JetpackͷNavigationίϯϙʔωϯτɺ୯७ͳϘλϯΫϦοΫ͔Βɺ ΞϓϦόʔφϏήʔγϣϯυϩϫʔͳͲͷෳࡶͳύλʔϯ·Ͱɺ͞·͟·ͳφ ϏήʔγϣϯΛ࣮͢Δͷʹཱͪ·͢ɻ • ·ͨɺNavigationίϯϙʔωϯτɺ֬͞Εͨݪଇͷηοτʹै͏͜ͱʹΑ ΓɺҰ؏ੑͷ͋Δ༧ଌ͍͢͠ϢʔβʔΤΫεϖϦΤϯεΛอূ͠·͢ɻ
ʁʁʁ 8
NavigationΛೖΕΔϝϦοτ 9 • ϑϥάϝϯτભҠͷτϥϯβΫγϣϯཧΛͯ͘͠ΕΔ • όοΫϘλϯͷ੍ޚΛͯ͘͠ΕΔ • ը໘ભҠ࣌ͷඪ४ΞχϝʔγϣϯΛఏڙ͍ͯ͠Δ • Deep
LinkΛ؆୯ʹ࣮Ͱ͖Δ • ࠷খݶͷՃ࡞ۀͰɺφϏήʔγϣϯυϩϫʔϘτϜφϏήʔγϣ ϯΛ࣮Ͱ͖Δ • Fragmentؒͷͷड͚͕͠؆୯…ɻͳͲͳͲɻ
NavigationΛೖΕΔϝϦοτ 10 • ϑϥάϝϯτભҠͷτϥϯβΫγϣϯཧΛͯ͘͠ΕΔ • όοΫϘλϯͷ੍ޚΛͯ͘͠ΕΔ • ը໘ભҠ࣌ͷඪ४ΞχϝʔγϣϯΛఏڙ͍ͯ͠Δ • Deep
LinkΛ؆୯ʹ࣮Ͱ͖Δ • ࠷খݶͷՃ࡞ۀͰɺφϏήʔγϣϯυϩϫʔϘτϜφϏήʔγϣ ϯΛ࣮Ͱ͖Δ • Fragmentؒͷͷड͚͕͠؆୯…ɻͳͲͳͲɻ
Navigationͷ Deep Link࣮ํ๏ 11
Navigationͷߏཁૉ 12 NavigationGraph 1. →શͯͷφϏήʔγϣϯؔ࿈ใΛҰͭͷॴͰूதతʹอ͢ΔxmlϦιʔεɻ NavHost 2. →φϏήʔγϣϯάϥϑ͔ΒͷѼઌΛදࣔ͢Δۭͷίϯςφɻ NavController 3.
→NavHostͷΞϓϦφϏήʔγϣϯΛཧ͢ΔΦϒδΣΫτɻ
Navigationͷߏཁૉ 13 NavigationGraph 1. →શͯͷφϏήʔγϣϯؔ࿈ใΛҰͭͷॴͰूதతʹอ͢ΔxmlϦιʔεɻ NavHost 2. →φϏήʔγϣϯάϥϑ͔ΒͷѼઌΛදࣔ͢Δۭͷίϯςφɻ NavController 3.
→NavHostͷΞϓϦφϏήʔγϣϯΛཧ͢ΔΦϒδΣΫτɻ
NavigationGraph 14 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation>
NavigationGraph 15 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation>
NavigationGraph 16 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Navigation Graphͷఆٛ • ͜ͷதʹ༻͢ΔࢠNavigationGraph FragmentΛՃ͍ͯ͘͠ɻ • startDestinationɿ͜ͷNavigationGraph ʹೖͬͨ࣌ʹॳΊͯදࣔ͢ΔFragment
NavigationGraph 17 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Fragmentͷఆٛ • ͜ͷதʹ༻͢ΔҾɺઃఆ͢Δ Deep LinkͷURLΛهࡌ͢Δɻ
NavigationGraph 18 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • ը໘ભҠͷఆٛ • ݱࡏͷFragment͔ΒͲͷFragmentʹભ Ҡ͢Δ͔͕ॻ͔Ε͍ͯΔɻ • ࠓͩͬͨΒSampleA͔ΒSampleB
NavigationGraph 19 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • FragmentͷҾ • Deep Linkͷύϥϝʔλ໊ͱҰக͍ͯ͠ Δඞཁ͕͋Δɻ
NavigationGraph 20 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Deep LinkͷURL • ͜Εઃఆ͢ΔͱɺϦϯΫ౿Μͩ࣌ʹભҠ Ͱ͖ΔΑ͏ʹͳΔɻ
21 ͳΜͩʂʂͬͺ؆୯͡ΌΜʂʂ
ͪΐͬͱͯɻ
όοΫελοΫ ͬͯͲ͏ͳͬͯΜͷʁʁ
ͷόοΫελοΫ NavigationGraphͷߏʹґଘ͍ͯ͠Δ Navigation x Deep Link
25 NavigationGraphX
26 NavigationGraphX FragmentA
27 NavigationGraphX FragmentA NavigationGraphY
28 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC
29 NavigationGraphX FragmentA FragmentB FragmentC ͜ͷߏͩͱɺόοΫϘλϯΛԡͨ͠߹ଈΞϓϦऴྃʂ
30 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC
31 ͜Εʹͯղܾʂʂ
ͪΐͬͱͯɻ
33 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖Δɻ
34 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖ͳ͍ʂʂ
35 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Deep Linkͬͨ࣌ͷͨΊʹ ֊ߏʹ͠ͳ͍ͱ͍͚ͳ͍ɻ ҧ͏֊ͷFragmentʹ
ભҠͰ͖ͳ͍ ࠈɻ
ແཧ͡ΌΜɻ
37 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖Δʂ ղܾࡦ
ղܾࡦ • Ұ֊ԼͷNavigationʹͳΒભҠͰ͖Δɻ ભҠ͍ͨ͠FragmentΛNavigationͷstartDestinationʹઃఆ͢Δ ҾNavigationʹઃఆ͢Δɻ • startDestinationʹઃఆͨ͠FragmentҎ֎ʹભҠ͍ͨ͠߹ startDestinationʹઃఆͨ͠FragmentͷonCreate()Ͱ ϑϥάΛνΣοΫͯ͠ભҠͤ͞Δɻ →
→
·ͱΊ 39 • NavigationͰDeep LinkΛ࣮͢Δͱ͖ɺ֊ߏΛҙࣝ͢Δɻ →Deep LinkͰભҠͨ࣌͠ʹੵΜͰ͓͍ͯ΄͍͠όοΫελοΫ௨Γʹ࡞Δ • ֊͕ҧ͏FragmentʹભҠͰ͖ͳ͍ɻ →NavigationΛҰճט·ͤͯɺstartDestinationͰભҠ͢Δɻ
• ϥϯλΠϜΤϥʔͰ͔͠ෆ۩߹ΛݕͰ͖ͳ͍ͷͰɺͪΐͬͱଟΊʹςετ ͢Δɻ • ͋ͱ͔Βमਖ਼͢ΔͱେมͳͷͰɺͳΔ͘࠷ॳ͔Β֊Λ࡞͓ͬͯ͘ɻ
͓ΘΓɻ 40