aeeble aeeble

Login

Use Material Design’s device metrics to plan an Android layout

When planning a screen, you may have a device’s pixel resolution but still need to know how much room your layout has. Google’s Material Design device metrics guide connects the physical screen size, aspect ratio and pixel count to the density-independent pixels used for Android layouts. The old Material 2 device reference now opens that worked guide on the Material Design 3 site. Material Design device metrics

Read one size in both units

Use the guide’s Pixel 4 example. Its summary lists a 5.7-inch diagonal, a 19:9 aspect ratio and a resolution of 1080 × 2280 pixels. It gives an approximate layout size of 392 × 822 dp. Read the smaller dimension when thinking about portrait width. Pixels describe the display’s resolution. Dp are the logical units Android uses to scale layout dimensions on screens with different densities. Google’s worked example · Android’s guide to pixel densities

Check the layout at the width the app will use

Suppose you are designing a card with a title, one line of explanatory text, and a button. On a narrow preview, check whether the title wraps and the button remains visible. Then try a wider preview of the same card. The article’s device example is a starting point. Use the space available to your app for the actual check, especially if the device can show more than one app at a time. If you are preparing bitmap images, the density bucket in the guide helps you find the corresponding asset scale. Android’s responsive layout guide

Images
Ratings
Related Lists