The Material Design specification has given detailed metrics for individual components (i.e. Views) but I couldn't find the recommended padding for an entire background layout.
For example, in the following screenshot taken from Material Design Guide, the SearchView is at a distance from the boundary of the background layout, and so will be other Views if/when added to this layout (I guess). So it looks like there is a padding for the full screen background layout in Material Design apps.
What is the recommended value of that?
Padding refers to the space between UI elements. Padding is an alternative spacing method to keylines and is measured in increments of 8dp or 4dp. Padding can be measured both vertically and horizontally and does not need to span the whole height of a layout. A layout with 24dp padding between components.
Padding is the space inside the border, between the border and the actual view's content. Note that padding goes completely around the content: there is padding on the top, bottom, right and left sides (which can be independent).
Material Components are interactive building blocks for creating a user interface, and include a built-in states system to communicate focus, selection, activation, error, hover, press, drag, and disabled states. Component libraries are available for Android, iOS, Flutter, and the web.
Density-independent pixels (dp) Density-independent pixels (pronounced “dips”) are flexible units that scale to uniform dimensions on any screen. When developing an Android application, use dp to display elements uniformly on screens with different densities.
Usually, the padding is added to your project if you use Android Studio to create the project. It's value depends on the screen size. For handheld devices, its value is 16dp
for top/bottom/right/left and for tablets it is 64dp
right/left and 16dp
for top/bottom.
AFAIK, the default activity padding is 16dp, so I guess the recommended amount must be also 16dp. Anyway, it depends on your screen size.
="@dimen/activity_horizontal_margin"
="@dimen/activity_vertical_margin"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With