@@ -15,8 +15,8 @@ next.link=adaptui.html
1515
1616
1717<!-- This is the training bar -->
18- <div id="tb-wrapper">
19- <div id="tb">
18+ <div id="tb-wrapper">
19+ <div id="tb">
2020
2121<h2>This lesson teaches you to</h2>
2222<ol>
@@ -33,16 +33,15 @@ Guidelines</a></li>
3333</ul>
3434
3535<h2>Try it out</h2>
36-
37- <div class="download-box">
36+
37+ <div class="download-box">
3838<a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
3939 the sample app</a>
40- <p class="filename">NewsReader.zip</p>
41- </div>
42-
43-
44- </div>
45- </div>
40+ <p class="filename">NewsReader.zip</p>
41+ </div>
42+
43+ </div>
44+ </div>
4645
4746<p>This lesson shows you how to support different screen densities
4847by providing different resources and using resolution-independent units of
@@ -54,28 +53,38 @@ measurements.</p>
5453absolute pixels to define distances or sizes. Defining layout dimensions with
5554pixels is a problem because different screens have different pixel densities,
5655so the same number of pixels may correspond to different physical sizes on
57- different devices. Therefore, when specifying dimensions, always use either
56+ different devices. Therefore, when specifying dimensions, always use either
5857<code>dp</code> or <code>sp</code> units. A <code>dp</code> is a density-independent pixel
5958that corresponds to the physical size of a pixel at 160 dpi. An <code>sp</code> is the same
6059base unit, but is scaled by the user's preferred text size (it’s a
6160scale-independent pixel), so you should use this measurement unit when defining
6261text size (but never for layout sizes).</p>
6362
64- <p>For example, when you specify spacing between two views, use <code>dp</code>
63+ <!-- video box -->
64+ <a class="notice-developers-video left" href="https://www.youtube.com/watch?v=zhszwkcay2A">
65+ <div>
66+ <h3>Video</h3>
67+ <p>DesignBytes: Density-independent Pixels</p>
68+ </div>
69+ </a>
70+
71+ <br style="clear:left">
72+
73+ <p>For example, when you specify spacing between two views, use <code>dp</code>
6574rather than <code>px</code>:</p>
6675
6776<pre>
68- <Button android:layout_width="wrap_content"
69- android:layout_height="wrap_content"
77+ <Button android:layout_width="wrap_content"
78+ android:layout_height="wrap_content"
7079 android:text="@string/clickme"
7180 android:layout_marginTop="20dp" />
7281</pre>
7382
7483<p>When specifying text size, always use <code>sp</code>:</p>
7584
7685<pre>
77- <TextView android:layout_width="match_parent"
78- android:layout_height="wrap_content"
86+ <TextView android:layout_width="match_parent"
87+ android:layout_height="wrap_content"
7988 android:textSize="20sp" />
8089</pre>
8190
0 commit comments