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
Android Jetpack: Navigationを使ってみる
Search
Yui Matsuura
May 17, 2018
Technology
4.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android Jetpack: Navigationを使ってみる
Yui Matsuura
May 17, 2018
More Decks by Yui Matsuura
See All by Yui Matsuura
★2.2のアプリがIn-App Review APIを導入して★4.2になるまで
teshi04
6
3.8k
Firebase AutoMLのオンデバイス実行とCameraXを組み合わせた新しい価値を秒で試す
teshi04
3
1.1k
技術書典アプリを作った話
teshi04
2
950
Create Layouts with the Wearable UI Library
teshi04
2
4.7k
Other Decks in Technology
See All in Technology
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
0
220
企業でAWS Organizationsを動かすための組織設計の考え方
nrinetcom
PRO
1
110
kaonavi Tech Night#1
kaonavi
0
110
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
12
8.7k
Making sense of Google’s agentic dev tools
glaforge
1
290
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
250
AI Coding Agent時代のcdk-nagガードレール 〜組織ルールを強制CIで守り抜く設計の挑戦〜
mhrtech
3
430
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
5.2k
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
420
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
1k
発表と総括 / Presentations and Summary
ks91
PRO
0
140
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
490
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
エンジニアに許された特別な時間の終わり
watany
108
250k
The agentic SEO stack - context over prompts
schlessera
0
850
Building Adaptive Systems
keathley
44
3.1k
Statistics for Hackers
jakevdp
799
230k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
Designing Powerful Visuals for Engaging Learning
tmiket
1
450
The untapped power of vector embeddings
frankvandijk
2
1.8k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
390
Paper Plane
katiecoart
PRO
2
52k
Navigating Weather and Climate Data
rabernat
0
380
ラッコキーワード サービス紹介資料
rakko
1
3.9M
Transcript
Android Jetpack: Navigationを使っ てみる Google I/O 2018 わいわい報告会 @teshi04
About me てし @teshi04 Yui Matuura Mercari/Marpay
Android Jetpack
Jetpack: Architecture • Databinding • Lifecycles • LiveData • Navigation
new! • Paging new! • Room • ViewModel • WorkManager new!
デモ
None
Navigationの課題 • Fragment Transition • Passing Arguments • Deep Links
• Up and Back • Testing • Error-prone Boilerplate
Architecture: Navigation ビジュアルツールとXML • Navigation Actions • Arguments • Animation
• Up behavior • Deep Link no more Fragment Transaction!
Gradle Dependency allprojects { repositories { google() jcenter() } }
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha01' implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha01'
NavHostFragmentを追加 activity_main.xml <fragment android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/my_nav_host_fragment" android:name="androidx.navigation.fragment.NavHostFragment" app:navGraph="@navigation/mobile_navigation" app:defaultNavHost="true" />
Navigation Graph
Actionを設定する
Actionを設定する
Navigation Graph(XML) mobile_navigation.xml <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" app:startDestination="@+id/launcher_home"> <fragment android:id="@+id/launcher_home"
android:name="com.example.android.codelabs.navigation.MainFragment" android:label="@string/home" tools:layout="@layout/main_fragment"> <action android:id="@+id/next_action" app:destination="@id/flow_step_one" ... app:popExitAnim="@anim/slide_out_right" /> </fragment> <fragment android:id="@+id/flow_step_one" android:name="com.example.android.codelabs.navigation.FlowStepFragment" tools:layout="@layout/flow_step_one_fragment"/> ...
NavControllerで遷移する MainFragment.kt transactionsButton.setOnClickListener { view -> Navigation.findNavController(view).navigate(R.id.next_action) }
まとめ • Android Jetpack: Navigationのメリット ◦ 画面遷移が可視化できる ◦ FragmentTransition, Animationが簡単とか
• Jetpack。手段の一つでしかない。使うか使わないかは アプリの次第だと思う
参考リンク • 「Android Jetpack: manage UI navigation with Navigation Controller
(Google I/O '18) https://www.youtube.com/watch?v=8GCXtCjtg40 • Sample https://github.com/googlesamples/android-architecture-c omponents/tree/master/NavigationBasicSample • Navigation Codelab https://codelabs.developers.google.com/codelabs/androi d-navigation/index.html • ドキュメント https://developer.android.com/topic/libraries/architecture/ navigation/
Thanks!