Friday, February 27, 2015

Android: xmlns res-auto

You can use "res-auto" URI instead of defining custom packages:

so...

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:my_tag="http://schemas.android.com/apk/res-auto"

instead of...

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:my_tag="http://schemas.android.com/apk/res/com.my_company.xyz"



and then use your tag...

       <com.my_company.xyz.control.MyPanelView
                android:id="@+id/jdhfkjsd"
                style="@style/kjdlksjdhjhk"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                my_tag:header="@string/kjsdlfkdslkfj"