Search code examples
androidandroid-layoutandroid-viewtoolbarandroid-toolbar

android:contentInsetLeft="0dp" vs app:contentInsetLeft="0dp"


I am trying to remove left space of toolbar. I see this https://stackoverflow.com/a/32320632/2455259 which seems working for me. I am unable to understand what is the meaning to add android and app namespace for same attribute.

Is there any difference between them ? android:contentInsetLeft="0dp" vs app:contentInsetLeft="0dp"


Solution

  • android namespace is reserved for views that are in the Android Framework.

    On the other hand, app namespace is for views from support library.

    So, in this case android will be applied to Toolbar that is shipped within Android SDK - android.widget.ToolBar. And app will be applied to the Toolbar that comes with support libraries.

    Obviously, there's no need to apply both android and app to the same view, because it is either from Android SDK or from support library.