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

Multi-module+Navigation

 Multi-module+Navigation

Masatoshi Kubode

June 18, 2019
Tweet

More Decks by Masatoshi Kubode

Other Decks in Programming

Transcript

  1. ©2019 Wantedly, Inc.
    .VMUJNPEVMF/BWJHBUJPO
    QPUBUPUJQT
    ٱอग़խढ़
    2019/06/18

    View full-size slide

  2. ©2019 Wantedly, Inc.
    ٱอग़խढ़
    8BOUFEMZ
    ओʹ8BOUFEMZ7JTJUͷ"OESPJEΞϓϦΛ։ൃ͍ͯ͠·͢ɻ
    ࠷ۙΞϓϦϦχϡʔΞϧ͕Ұஈམͨ͠
    ,PUMJO .BHJDUIF(BUIFSJOH 1PLFNPO(P
    ࣗݾ঺հ
    5XJUUFS
    !TXJ[@BSE
    (JU)VC
    !LVCPEF

    View full-size slide

  3. ©2019 Wantedly, Inc.
    w "OESPJE9/BWJHBUJPOBMQIB
    w /BWJHBUJPO৮ͬͨ͜ͱ͋Δਓ޲͚
    w Ϟδϡʔϧ͸͜͏͍͏ߏ੒
    w ਐߦܗͰະϦϦʔε
    લఏ

    View full-size slide

  4. ©2019 Wantedly, Inc.
    w (6*9.-ͰભҠਤ͕ఆٛͰ͖Δ
    w %FFQ-JOL
    w TBGFBSHT
    AndroidX Navigation

    View full-size slide

  5. ©2019 Wantedly, Inc.
    8IZ.VMUJNPEVMF/BWJHBUJPO
    .VMUJNPEVMF/BWJHBUJPOͷ࣮૷ύλʔϯ
    ࠾༻ͨ͠ख๏
    ·ͱΊ
    ࿩͢͜ͱ

    View full-size slide

  6. ©2019 Wantedly, Inc.
    8IZ.VMUJNPEVMF/BWJHBUJPO

    View full-size slide

  7. ©2019 Wantedly, Inc.
    w Ҏલ͔ΒϚϧνϞδϡʔϧԽΛਐΊ͍ͯͨ
    w $PNNPO"DUJWJUZ'SBHNFOU
    w ΍͹͍΍ͭ
    w ґଘੑͷմ
    Why

    View full-size slide

  8. ©2019 Wantedly, Inc.
    w $PNNPO'SBHNFOU
    w ਌͕$PNNPO"DUJWJUZ͡Όͳ͍ͱͩΊ
    w GSBHNFOUUFTUJOH͕࢖͑ͳ͍
    w ભҠઌͷ'SBHNFOUͷࢀর͕ඞཁ
    w Ϟδϡʔϧ෼ׂͷअຐʹ
    Why

    View full-size slide

  9. ©2019 Wantedly, Inc.
    w ςελϒϧʹ͍ͨ͠
    w ґଘੑΛݮΒ͍ͨ͠
    w $PNNPO"DUJWJUZ'SBHNFOUΛফ͍ͨ͠

    /BWJHBUJPOͰղܾ͠Α͏
    Why

    View full-size slide

  10. ©2019 Wantedly, Inc.
    .VMUJNPEVMF/BWJHBUJPOͷ࣮૷ࣄྫ

    View full-size slide

  11. ©2019 Wantedly, Inc.
    w ಋೖલʹ࣮૷ྫΛௐࠪ
    w ৚݅
    w ಉ͡Α͏ͳϞδϡʔϧߏ੒
    w ϞδϡʔϧΛ·͍ͨͩભҠ͕ߟྀ͞Ε͍ͯΔ
    ࣮૷ྫΛௐ΂Δ

    View full-size slide

  12. ©2019 Wantedly, Inc.
    w %SPJE,BJHJDPOGFSFODFBQQ
    • https://github.com/DroidKaigi/conference-app-2019
    w /BWJHBUJPOJO.VMUJ.PEVMF1SPKFDUT
    • https://proandroiddev.com/navigation-in-multi-module-projects-9a5c53ad219
    w +FUQBDL/BWJHBUJPO
    • https://events.google.com/io/schedule/events/2d0cb491-325a-48fb-8eea-6a9452f3b33b
    Link

    View full-size slide

  13. ©2019 Wantedly, Inc.
    • ΞϓϦͰ1ͭͷXML
    • Լ૚ϞδϡʔϧʹXML
    • featureͰsafe-args͕࢖͑Δ
    • IDEαϙʔτ͕ͳ͍
    • featureͷԼ૚ͳͷͰFragment͕ݟ͑ͳ͍
    DroidKaigi2019

    View full-size slide

  14. ©2019 Wantedly, Inc.
    • ProAndroidDevͷهࣄ
    • ΞϓϦͰ1ͭͷXML
    • ্૚ϞδϡʔϧʹXML
    • Լ૚ϞδϡʔϧʹΠϯλʔϑΣʔε
    • IDEαϙʔτ͋Γ
    • featureͰsafe-args͕࢖͑ͳ͍
    • ΠϯλʔϑΣʔεͱ࣮૷ͷϝϯς
    • DI͕ඞཁ
    Navigation in Multi-Module Projects

    View full-size slide

  15. ©2019 Wantedly, Inc.
    • Google I/O 2019ͷηογϣϯ
    • feature͝ͱʹ1ͭͷXML
    • ্૚ͷXMLͰfeatureͷXMLΛ͢΂ͯincludeͯ͠·ͱΊΔ
    • IDEαϙʔτ͋Γ
    • featureͰsafe-args͕࢖͑Δ
    • ભҠઌͷDeepLinkΛ஌Βͳ͍ͱ͍͚ͳ͍
    Jetpack Navigation

    View full-size slide

  16. ©2019 Wantedly, Inc.
    Jetpack Navigation

    View full-size slide

  17. ©2019 Wantedly, Inc.
    ࠾༻ͨ͠ख๏

    View full-size slide

  18. ©2019 Wantedly, Inc.
    w νʔϜͰ૬ஊ͠(PPHMF*0ͷํ๏Λ࠾༻ͨ͠
    w %FFQ-JOL͸TFBMFEDMBTTΛఆٛ
    w 63*΂ͨॻ͖Λ๷͙
    ࠾༻ͨ͠ख๏

    View full-size slide

  19. ©2019 Wantedly, Inc.
    ࠾༻ͨ͠ख๏
    sealed class MyDestination(path: String) {
    val deepLink = "my://$path".toUri()
    data class Feature1(val id: Int) : MyDestination("feature1/$id")
    data class Feature2(val id: Int) : MyDestination("feature2/$id")
    }
    fun onClick() {
    navController.navigate(MyDestination.Feature1(1).deepLink)
    }

    View full-size slide

  20. ©2019 Wantedly, Inc.
    ·ͱΊ

    View full-size slide

  21. ©2019 Wantedly, Inc.
    w ࣮૷ύλʔϯ͸͍͔ͭ͋͘Δ
    w ૬ஊͯ͠࠷దͳ࣮૷ΛબͿͱྑͦ͞͏
    w "MQIBͳͷͰόά͕ଟ͍ɺ֮ޛ͕ඞཁ
    ·ͱΊ

    View full-size slide

  22. ©2019 Wantedly, Inc.

    View full-size slide