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
Navigation ComponentとFluxをnanaに導入した
Search
Young
March 25, 2019
Programming
0
83
Navigation ComponentとFluxをnanaに導入した
社内勉強会 #深いい勉強会 の資料です
Young
March 25, 2019
Tweet
Share
More Decks by Young
See All by Young
GitbookからOpenApiへのAPIドキュメント移行
akihitookada
0
81
Androidアプリにおけるモジュラライズの進め方
akihitookada
0
200
MotionLayoutを使ってクリスマスなアプリを作った
akihitookada
0
110
OrmaからRoomに移行する 2nd Season
akihitookada
1
650
ミャンマーのすゝめ
akihitookada
2
88
Android版 nanaとデータの永続化とDatabase
akihitookada
2
190
Android Team @ nana music, Inc.
akihitookada
0
89
ConstraintLayoutを理解する
akihitookada
0
100
OpenSTFとJenkinsで 社内のAndroid端末を有効活用する
akihitookada
0
270
Other Decks in Programming
See All in Programming
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
CSC509 Lecture 11
javiergs
PRO
0
180
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1.1k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
1
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
初めてDefinitelyTypedにPRを出した話
syumai
0
430
Quine, Polyglot, 良いコード
qnighy
4
650
Remix on Hono on Cloudflare Workers
yusukebe
1
310
Featured
See All Featured
What's new in Ruby 2.0
geeforr
343
31k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Adopting Sorbet at Scale
ufuk
73
9.1k
Teambox: Starting and Learning
jrom
133
8.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building Your Own Lightsaber
phodgson
103
6.1k
Ruby is Unlike a Banana
tanoku
97
11k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
A Tale of Four Properties
chriscoyier
156
23k
Side Projects
sachag
452
42k
Transcript
Navigation Componentͱ FluxΛnanaʹಋೖͨ͠
Young @ nana music Android Engineer
Navigation Component
Navigation Componentͱ • Google I/O 2018ͰՃ • ը໘ભҠͷॲཧΛ؆୯ʹ࣮Ͱ͖Δ • 2019/03/14
Stable Release
Pros • Navigaton Graphʹը໘ભҠ͕໌ࣔతʹදݱ͞ΕΔͨΊɺ༷ͷڞ༗͕؆୯ʹ • XML͚ͩͰભҠઌɾΓઌɾભҠ࣌ͷҾΛΑΓ҆શʹఆٛͰ͖Δ • ભҠ࣌ͷϝιουΛࣗಈੜͯ͘͠ΕΔͷͰɺόάΛੜΈʹ͍͘ • AndroidͳΒͰͷը໘ભҠͷۤ࿑Λղফͯ͘͠ΕΔ
• ը໘ભҠը໘ͷελοΫཧProgrammaticʹಠࣗʹॻ͘ඞཁ͕͋ͬͨ • Activity : Fragment 1:nͷߏɺཧෳࡶͰόάΛੜΈ͍͢ͷͰආ͚ΒΕΔʹ͋ͬͨ • Activity : Fragment 1:1ͷߏɺཧߏ͕γϯϓϧͰਓؾ͕ࠜڧ͍ҹ͕͋ͬͨ • NavigationͰActivity : Fragment 1:n͕جຊߏɻ͜Ε͔ΒActivity / FragmentͷΈ ํ͕มΘͬͯ͘ΔͱࢥΘΕΔ
Cons • ݟͨΒͳ͍ • ࢥΘ͵ͱ͜ΖͰ͍᪴ͨΓόάΛ౿Έͦ͏ʁ
Refs • Navigation Codelab • https://codelabs.developers.google.com/ codelabs/android-navigation/#0
ͬͨ͜ͱ • ϩάΠϯϑϩʔͷϦϓϨΠε
Navigation Graph
Demo
Flux
Fluxͱ • Facebook͕ఏএͨ͠ϑϩϯτͷWebΞϓϦ έʔγϣϯͷΞʔΩςΫνϟ • Droidkaigi2019ͷConference app 2019Ͱ࠾ ༻ •
Androidͷ։ൃʹ͓͍ͯಋೖࣄྫ͕૿͍͑ͯ Δ
Fluxͱ Refs : https://github.com/DroidKaigi/conference-app-2019
Pros • σʔλ͕ҰํʹྲྀΕɺෳࡶͳॲཧͰ͖ͬ͢Γͱॻ͘͜ͱ ͕Ͱ͖Δ • ϏδωεϩδοΫΛݺͿॲཧɺViewʹঢ়ଶΛө͢Δॲ ཧ͕͞ΕΔ • ഥखͷΑ͏ͳΞϓϦΞΫγϣϯͷෳը໘ͷViewͷ өॲཧͳͲΛɺڞ௨Խ͖ͭͭ͠Ε͍ʹॻ͘͜ͱ͕Ͱ͖Δ
• FluxͷϑϩʔͷதͰɺViewͷөॲཧΛఆٛͰ͖Δ
Cons • FluxΛߏ͢ΔΈʹର͢Δֶशίετ͕ ͔͔Δ • ߏཁૉͱͳΔLiveDataɺViewModelɺ Coroutines/RxJavaͳͲͷࣝඞཁ • MVPMVVM͔ΒͷҠߦগ͠େม
Refs • DroidKaigi / conference-app-2019 • https://github.com/DroidKaigi/conference- app-2019
ͬͨ͜ͱ • FluxͷࠎΈ෦ΛConference app 2019ͷιʔείʔυΛࢀߟʹ࣋ͬ ͯ͘Δ • MVVM͔ΒҠߦ • ViewModelΛActionCreatorʹஔ͖͑Δ
• ViewModelʹఆٛͨ͠LiveDataΛStoreʹҠ͢ • DatabindingViewͷInstanceੜͷΈʹݶఆ͢Δ • ViewͷΠϯλϥΫγϣϯFragmentͰཧ͢Δ
Demo
Conclusion • ϘΠϥʔϓϨʔτίʔυ͕ݮΓɺ։ൃ͕γϯϓϧʹͳ͍ͬͯ͘ • αϯϓϧ͕ެ։͞Ε͍ͯΔͷͰಋೖ͕؆୯ • Android։ൃʹ͓͍ͯConference appCodelabͳͲͷ໌ࣔతͳࢦΛϑΥϩʔ ͢Δ͜ͱવʹͳΓɺڞ௨ݴޠʹͳΓͭͭ͋Δ •
JavaͰॻ͔ΕͨϨΨγʔͳίʔυগͣͭ͠ϦϓϨΠεΛਐΊΒΕΔͱྑͦ͞͏ • KotlinԽ -> DatabindingԽ -> FluxԽ • nana ͷAndroid։ൃࠓޙɺNavigationͱFluxͰ