How to change application colors with Flavors in Android

Viewed 1334

In my application, I have 2 flavors, and I want to change the application's color (res/color) for each of this flavors!

Please see my code below at build.gradle file :

flavorDimensions "default"
productFlavors {
    app1 {
        applicationId "com.app.myApp1"
        resValue "string", "app_name", "App 1"
        manifestPlaceholders = [
                appIcon: "@drawable/logo_app1"
        ]
    }
    app2 {
        applicationId "com.app.myApp2"
        resValue "string", "app_name", "App 2"
        manifestPlaceholders = [
                appIcon: "@drawable/logo_app2"
        ]
    }
}

I don't know on setting the color.xml for each of this flavors!

How can this be possible?

1 Answers
Related