Android "tools" namespace in layout xml documentation

We've just added support for designtime attributes like this in Android Studio 0.2.11. See http://tools.android.com/tips/layout-designtime-attributes for more.


You will find tool attribute when you set object in graphical layout.

Listview (in graphical mode) -> right Click -> Preview List Content -> Choose Layout...

produces:

tools:listitem="@layout/customer_list_item"

Think of them as design time helpers only.They do not get processed in actual view rendering at run time.

For example you want to set background of some view in your layout design when working on android studio so that you can make clear distinction where that particular view is.So you would normally do that with

android:background="@color/<some-color>"

Now risk is that sometimes we forget to remove that color and it gets shipped in apk. instead you can do as follows:

tools:background="@color/<some-color>"

These changes will be local to android studio and will never get transferred to apk.

And also check out http://tools.android.com/tech-docs/tools-attributes for more options.