Search code examples
androidandroid-layoutmaterial-designandroid-design-libraryandroiddesignsupport

Is overriding Android toolbar default padding considered bad practice?


Since API 21, android Toolbar has a default padding of 16dp,caused by Toolbar's contentInsetStart which by default is 16dp.

On Google material guidelines :

http://www.google.fr/design/spec/layout/structure.html#structure-app-bar

We can see two examples of toolbar with a padding of 16 and 24dp.

As there's no do & don't on it, I was wondering if overriding the default padding was considered bad practice ? For example, should I use a toolbar with a padding of 32dp ?

Thank you for your answers


Solution

  • These two paddings should be used on phone (16dp) and tablet (24dp). You shouldn't override those paddings as each of them was studied and prepared for a specific kind of device.

    The general rule is that you should align items, so when the user scrolls and skims the content, his mind and actions are not disturbed. This means that if you have a good reason, you can override paddings as long as you keep your layout aligned to guides by keeping same paddings for all items in your app.