2

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"

azizbekian
  • 60,783
  • 13
  • 169
  • 249
N Sharma
  • 33,489
  • 95
  • 256
  • 444

2 Answers2

2

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.

azizbekian
  • 60,783
  • 13
  • 169
  • 249
1

android:contentInsetLeft should be used with the native Toolbar android.widget.ToolBar while app:contentInsetLeft has to be used with the Toolbar from the support library android.support.v7.widget.Toolbar. As rule of thumb, res-auto namespace is used with the support-library

Blackbelt
  • 156,034
  • 29
  • 297
  • 305