I have an Android app divided into four different build styles. Each of these flavors is part of the unique files javaand xmland part of the shared files in main. For clarity, let me call them Cucumber, Tomato, Onionand Pepper. These flavors have unique layouts, drawings, lines, colors, java files, etc.
Now my requirement is to divide my fragrance Pepperinto two sub-flavors; Red-Pepperand Green-Pepper. The layouts for these two fragrances should be the same - the only difference is that the two fragrances must use different resources drawableand string. I do not want to have duplicate layout files in both red and green flavors for obvious reasons.
How can this be achieved in gradle?
source
share