Slide 1

Slide 1 text

OBWJHBUJPOΛݟਾ͑ͨϦϑΝΫλϦϯά
 dϚϧνϞδϡʔϧԽΛఴ͑ͯd #POpSF"OESPJE ໦಺ɹܒี

Slide 2

Slide 2 text

໦಺ܒี w ৬ۀɿ:ͷ"OESPJEΤϯδχΞ݉ҭࣇύύ w झຯͰ࡞ͬͨϞϊɿʮΒ͘ͰΜ "QQ ʯɺ
 ʮ$MFBO"SDIJUFDUVSF5FNQMBUF'PS,PUMJO 044 ʯ w ޷͖ͳΞʔΩςΫνϟɿ$MFBO"SDIJUFDVUF w 4/4
 5XJUUFS!GFJ@LPNF
 (JUIVC!LJVDIJLFJTVLF
 2JJUB!L@LFJTVLF

Slide 3

Slide 3 text

એ఻ͦͷ̍ w ٕज़ॻయ ʹͯαʔΫϧඈཾ͞Μ͔ͪΒ
 ʮϥϊϕ෩ʹ
 $MFBO"SDIJUFDUVSFΛֶͿຊʯ
 తͳಉਓࢽग़͠·ʔ͢

Slide 4

Slide 4 text

એ఻ͦͷ̎

Slide 5

Slide 5 text

ࠓճͷωλ ϑΝΠφϯεΞϓϦΛ͕ͬͭΓ
 ϦϑΝΫλϦϯά͠Α͏ͱͨ࣌͠ͷग़དྷࣄ ґଘؔ܎ ࢖༻ؔ܎

Slide 6

Slide 6 text

"QQ ͜Μͳײ͡ͳ΍ͭΛɾɾɾ 1SFTFOUFS %BUB

Slide 7

Slide 7 text

͜Μͳײ͡ʹ͍ͨ͠ "QQ 1SFTFOUFS %BUB %PNBJO 'SBHNFOU 'SBHNFOU 'SBHNFOU OBWJ HBUJPO ɾ ɾ ɾ

Slide 8

Slide 8 text

1SFTFOUFS OBWJHBUJPOಋೖ͢Δ্Ͱݟ͖͑ͯͨ໰୊఺ w BQQ഑Լͷ'SBHNFOU͕OBWJHBUJPO͔Βݟ͑ͳ͍ w Ϋϥεؒͷ૬ޓґଘ͕ଟ͘શΫϥε͕͓Ҿӽ͢͠Δ੎͍ͩͬͨ w ը໘ભҠܥͷॲཧ͕৭ΜͳॴʹࢄΒ͹͍͙ͬͯͯ͢ʹ͸ಋೖͰ͖ͳ͔ͬͨ "QQ 'SBHNFOU 'SBHNFOU ɾ ɾ ɾ 'SBHNFOU OBWJ HBUJPO 'SBHNFOU 'SBHNFOU 'SBHNFOU 'SBHNFOU TPNF$MBTT TPNF$MBTT TPNF$MBTT TPNF$MBTT

Slide 9

Slide 9 text

ં஭Ҋʜ

Slide 10

Slide 10 text

কདྷOBWJHBUJPOΛಋೖ͠΍͍͢ Α͏ʹϦϑΝΫλϦϯά͠Α͏

Slide 11

Slide 11 text

΍ͬͨ͜ͱ ґଘͷ޲͖Λٯసͤͭͭ͞ OBWJHBUJPOʹؔ࿈͢ΔॲཧΛू໿ͨ͠

Slide 12

Slide 12 text

͜ΕΛɾɾɾ w 3FGBDUPSFE'SBHNFOU͔Β͸'SBHNFOU ͕ݟ͑ͳ͍ 1SFTFOUFS "QQ 3FGBDUPSFE
 'SBHNFOU 'SBHNFOU ɾ ɾ ɾ 'SBHNFOU

Slide 13

Slide 13 text

͜͏ͨ͠ w /BWJ*OUFSGBDFΛ௨ͯؒ͠઀తʹ'SBHNFOU ΁ΞΫηεͰ͖ΔΑ͏ʹͨ͠ 1SFTFOUFS "QQ 3FGBDUPSFE
 'SBHNFOU 'SBHNFOU ɾ ɾ ɾ 'SBHNFOU /BWJ
 *OUFSGBDF /BWJ
 *OUFSGBDF
 *NQM

Slide 14

Slide 14 text

1SFTFOUFS "QQ ࣮૷ interface NaviInterface { fun getFragment2(): Fragment fun getFragment3(data: SomeData): Fragment } class RefactoredFragment { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { android.R.id.home -> changeFragment(naviInterface.getFragment2()) R.id.action_sub -> changeFragment(naviInterface.getFragment3(data)) } return super.onOptionsItemSelected(item) } } class NaviInterfaceImpl : NaviInterface { override fun getFragment2(): Fragment = Fragment2.newInstance() override fun getFragment3(data: SomeData): Fragment = Fragment3.newInstance(data.code, data.name) } OBWJHBUJPOΛ࢖͏ͱ͖͸͜ΕΒΛ ஔ͖׵͑Ε͹0, ͩͱࢥ͏ OBWJHBUJPOʹ͢Δ࣌͸
 ͜ΕΒΛஔ͖׵͑Ε͹0,

Slide 15

Slide 15 text

OBWJHBUJPO༻ͷॲཧ͕ू໿ग़དྷͯ
 1SFTFOUFS͕BQQʹґଘ͠ͳ͘ͳͬͨ

Slide 16

Slide 16 text

ऄ଍ͦͷ̍ w ͜ͷख๏ͬͯଞͷϨΨγʔͳ"QJ΍6UJMݺͼग़͠ʹ΋࢖͑ΔΜ͡Όʁ
 ˠ:&4 1SFTFOUFS "QQ 3FGBDUPSFE
 'SBHNFOU -FHBDZ6UJM ɾ ɾ ɾ -FHBDZ"QJ -FHBDZ
 *OUFSGBDF -FHBDZ
 *OUFSGBDF
 *NQM -FHBDZ
 *OUFSGBDF -FHBDZ
 *OUFSGBDF -FHBDZ
 *OUFSGBDF
 *NQM -FHBDZ
 *OUFSGBDF
 *NQM

Slide 17

Slide 17 text

ऄ଍ͦͷ w ͦ΋ͦ΋OBWJHBUJPOΛBQQ಺ʹ࣮૷͢Ε͹Α͔ͬͨͷͰ͸ʁ
 ˠ:&4 1SFTFOUFS "QQ 3FGBDUPSFE
 'SBHNFOU 'SBHNFOU ɾ ɾ ɾ 'SBHNFOU OBWJ
 HBUJPO

Slide 18

Slide 18 text

·ͱΊ w ґଘͷ޲͖Λٯసͤ͞Ε͹ɺ1SFTFOUFSϞδϡʔϧ͔ΒBQQϞδϡʔϧ΁ ͷؒ઀తͳࢀর͕Մೳ OBWJHBUJPOҎ֎ʹ΋৭ΜͳγʔϯͰར༻Մೳ w ͦ΋ͦ΋OBWJHBUJPOͷ࣮૷ΛBQQϞδϡʔϧͰߦ͑͹ґଘੑΛ
 ؾʹ͠ͳͯ͘ྑ͍

Slide 19

Slide 19 text

͓ΘΓ