what about package names in xml files when having several package names according to flavor configuration

11 views
Skip to first unread message

Eunjae Lee

unread,
Dec 26, 2013, 9:18:52 PM12/26/13
to gradle-androi...@googlegroups.com
Let's say I've configured a product flavor configuration like following:

android {
    ...

    defaultConfig {
        minSdkVersion 8
        versionCode 10
    }

    productFlavors {
        flavor1 {
            packageName "com.example.flavor1"
            versionCode 20
        }

        flavor2 {
            packageName "com.example.flavor2"
            minSdkVersion 14
        }
    }
}


However, I currently have custom views used in layout xmls like following:

    <com.example.flavor.customview.TitleBarView
        android:id="@+id/titlebar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/titlebar_height"
        android:layout_alignParentTop="true" />
 
What about that package name?
Should I extract that package name to strings.xml?
That doesn't sound pretty.

Does anyone know how to manage package names in xml when having different package names?

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages