Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Navigation ComponentとFluxをnanaに導入した

Young
March 25, 2019

Navigation ComponentとFluxをnanaに導入した

社内勉強会 #深いい勉強会 の資料です

Young

March 25, 2019
Tweet

More Decks by Young

Other Decks in Programming

Transcript

  1. Pros • Navigaton Graphʹը໘ભҠ͕໌ࣔతʹදݱ͞ΕΔͨΊɺ࢓༷ͷڞ༗͕؆୯ʹ • XML͚ͩͰભҠઌɾ໭ΓઌɾભҠ࣌ͷҾ਺ΛΑΓ҆શʹఆٛͰ͖Δ • ભҠ࣌ͷϝιουΛࣗಈੜ੒ͯ͘͠ΕΔͷͰɺόάΛੜΈʹ͍͘ • AndroidͳΒͰ͸ͷը໘ભҠͷۤ࿑Λղফͯ͘͠ΕΔ

    • ը໘ભҠ΍ը໘ͷελοΫ؅ཧ͸Programmaticʹಠࣗʹॻ͘ඞཁ͕͋ͬͨ • Activity : Fragment 1:nͷߏ੒͸ɺ؅ཧ͸ෳࡶͰόάΛੜΈ΍͍͢ͷͰආ͚ΒΕΔ܏޲ʹ͋ͬͨ • Activity : Fragment 1:1ͷߏ੒͸ɺ؅ཧߏ଄͕γϯϓϧͰਓؾ͕ࠜڧ͍ҹ৅͕͋ͬͨ • NavigationͰ͸Activity : Fragment 1:n͕جຊߏ੒ɻ͜Ε͔Β͸Activity / Fragmentͷ૊Έ ํ͕มΘͬͯ͘ΔͱࢥΘΕΔ
  2. ΍ͬͨ͜ͱ • Fluxͷࠎ૊Έ෦෼ΛConference app 2019ͷιʔείʔυΛࢀߟʹ࣋ͬ ͯ͘Δ • MVVM͔ΒҠߦ • ViewModelΛActionCreatorʹஔ͖׵͑Δ

    • ViewModel಺ʹఆٛͨ͠LiveDataΛStoreʹҠ͢ • Databinding͸ViewͷInstanceੜ੒ͷΈʹݶఆ͢Δ • ViewͷΠϯλϥΫγϣϯ͸FragmentͰ؅ཧ͢Δ
  3. Conclusion • ϘΠϥʔϓϨʔτίʔυ͕ݮΓɺ։ൃ͕γϯϓϧʹͳ͍ͬͯ͘ • αϯϓϧ͕ެ։͞Ε͍ͯΔͷͰಋೖ͕؆୯ • Android։ൃʹ͓͍ͯConference app΍CodelabͳͲͷ໌ࣔతͳࢦ਑ΛϑΥϩʔ ͢Δ͜ͱ͸౰વʹͳΓɺڞ௨ݴޠʹͳΓͭͭ͋Δ •

    JavaͰॻ͔ΕͨϨΨγʔͳίʔυ΋গͣͭ͠ϦϓϨΠεΛਐΊΒΕΔͱྑͦ͞͏ • KotlinԽ -> DatabindingԽ -> FluxԽ • nana ͷAndroid։ൃ͸ࠓޙɺNavigationͱFluxͰ