• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=Metrics and Grids
2page.tags="layout","screens"
3@jd:body
4
5<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
6inch">DPI</acronym>). To simplify the way you design for multiple screens, think of each device as
7falling into a particular size bucket and density bucket. The size buckets are <em>handset</em> (smaller than
8600<acronym title="Density-independent pixels. One dp is one pixel on a 160 dpi
9screen.">dp</acronym>) and <em>tablet</em> (larger than or equal 600dp). The density buckets are <acronym
10title="Low density (120 dpi)">LDPI</acronym>, <acronym title="Medium density (160
11dpi)">MDPI</acronym>, <acronym title="High density (240 dpi)">HDPI</acronym>, and <acronym title
12="Extra-high density (320 dpi)">XHDPI</acronym>. Optimize your application's UI by designing
13alternative layouts for some of the different size buckets, and provide alternative bitmap images
14for different density buckets.</p>
15
16<div class="layout-content-row">
17  <div class="layout-content-col span-8">
18
19    <img src="{@docRoot}design/media/metrics_diagram.png">
20
21  </div>
22  <div class="layout-content-col span-5">
23
24<h4>Space considerations</h4>
25<p>Devices vary in the amount of density-independent pixels (dp) they can display.</p>
26<p>To see more, visit the
27<a href="http://developer.android.com/resources/dashboard/screens.html" target="_blank">
28Screen Sizes and Densities Device Dashboard</a>.</p>
29
30  </div>
31</div>
32
33<h2 id="48dp-rhythm">48dp Rhythm</h2>
34
35<p>Touchable UI components are generally laid out along 48dp units.</p>
36
37<img src="{@docRoot}design/media/metrics_48.png">
38
39<div class="vspace size-2">&nbsp;</div>
40
41<h4>Why 48dp?</h4>
42<p>On average, 48dp translate to a physical size of about 9mm (with some variability). This is
43comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users
44will be able to reliably and accurately target them with their fingers.</p>
45<p>If you design your elements to be at least 48dp high and wide you can guarantee that:</p>
46<ul>
47<li>your targets will never be smaller than the minimum recommended target size of 7mm regardless of
48  what screen they are displayed on.</li>
49<li>you strike a good compromise between overall information density on the one hand, and
50  targetability of UI elements on the other.</li>
51</ul>
52
53<img src="{@docRoot}design/media/metrics_closeup.png">
54
55<div class="vspace size-2">&nbsp;</div>
56
57<h4>Mind the gaps</h4>
58<p>Spacing between each UI element is 8dp.</p>
59
60<h2 id="examples">Examples</h2>
61
62<img src="{@docRoot}design/media/metrics_forms.png">
63