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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
940
Create Layouts with the Wearable UI Library
teshi04
2
4.7k
Other Decks in Technology
See All in Technology
Bucharest Tech Week 2026 - Guardians of the Cloud-Native Galaxy
edeandrea
PRO
0
120
人材育成分科会.pdf
_awache
4
300
AIはどのように 組織のアジリティを変えるのか?
junki
4
1k
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
120
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
240
手塩にかけりゃいいってもんじゃない
ming_ayami
0
610
生成 AI 実践ガイド (概略版) AIガバナンス編
asei
0
130
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
160
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
170
iAEONの段階的リアーキテクト戦略 / iAEON's_Gradual_Re-architecture_Strategy
aeonpeople
0
230
SteampipeとExcel Power QueryでAWS構成定義書の作成を自動化する
jhashimoto
0
160
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
RailsConf 2023
tenderlove
30
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
The SEO Collaboration Effect
kristinabergwall1
1
490
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
150
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Context Engineering - Making Every Token Count
addyosmani
9
970
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
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!