Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Different navigation graph for different flavors #117

@pavel-kozel

Description

@pavel-kozel

I have an Android project with two flavor_a, flavor_b. flavor_a and flavor_b share common snippets for navigation, but also have a few differences in their workflow. These are different means, you only need to use one fragment instead of the other (the differences are in 2 fragments out of 5)

I tried to create 2 graph for 2 flavor with the same name, but ids didn't generate.
Is it possible to use a different navigation graph with existing fragments and source code?

Source folder structure
-- main   
   -- common fragment_1   
   -- common fragment_2   
   -- common fragment_3   
 --res
    (without graph)
-- flavor_a
   -- src
     -- fragment_a
   -- res
      -- navigation
         --navigation_graph.xml
-- flavor_b
  -- src
    -- fragment_b
   --res
     --navigation
         --navigation_graph.xml

Common issue at stackoverflow:
https://stackoverflow.com/questions/64781855/is-it-possible-use-different-navigation-graph-with-different-flavours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions