Skip to content

Commit 33372b2

Browse files
Megha JoshiAndroid (Google) Code Review
authored andcommitted
Merge "A few updates for TVs." into ics-mr1
2 parents 84099f3 + 500cc4b commit 33372b2

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

docs/html/training/multiscreen/screensizes.jd

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ to implement these layouts, you could have the following files:</p>
164164

165165
{@sample development/samples/training/multiscreen/newsreader/res/layout/onepane.xml all}
166166
</li>
167-
<li><code>res/layout-xlarge/main.xml</code>, two-pane layout:
167+
<li><code>res/layout-large/main.xml</code>, two-pane layout:
168168

169169
{@sample development/samples/training/multiscreen/newsreader/res/layout/twopanes.xml all}
170170
</li>
171171
</ul>
172172

173-
<p>Notice the <code>xlarge</code> qualifier in the directory name of the second layout. This layout
174-
will be selected on devices with screens classified as extra-large (for example, 10" tablets). The
173+
<p>Notice the <code>large</code> qualifier in the directory name of the second layout. This layout
174+
will be selected on devices with screens classified as large (for example, 7" tablets and above). The
175175
other layout (without qualifiers) will be selected for smaller devices.</p>
176176

177177

@@ -188,7 +188,7 @@ though they are all considered to be "large" screens. That's why Android introdu
188188
width given in dp. For example, the typical 7" tablet has a minimum width of
189189
600 dp, so if you want your UI to have two panes on those screens (but a single
190190
list on smaller screens), you can use the same two layouts from the previous section for single
191-
and two-pane layouts, but instead of the <code>xlarge</code> size qualifier, use
191+
and two-pane layouts, but instead of the <code>large</code> size qualifier, use
192192
<code>sw600dp</code> to indicate the two-pane layout is for screens on which the smallest-width
193193
is 600 dp:</p>
194194

@@ -209,9 +209,9 @@ while smaller screens will select the <code>layout/main.xml</code> (single-pane)
209209
layout.</p>
210210

211211
<p>However, this won't work well on pre-3.2 devices, because they don't
212-
recognize <code>sw600dp</code> as a size qualifier, so you still have to use the <code>xlarge</code>
212+
recognize <code>sw600dp</code> as a size qualifier, so you still have to use the <code>large</code>
213213
qualifier as well. So, you should have a file named
214-
<code>res/layout-xlarge/main.xml</code>
214+
<code>res/layout-large/main.xml</code>
215215
which is identical to <code>res/layout-sw600dp/main.xml</code>. In the next section
216216
you'll see a technique that allows you to avoid duplicating the layout files this way.</p>
217217

@@ -222,20 +222,20 @@ you'll see a technique that allows you to avoid duplicating the layout files thi
222222
Therefore, you should also still use the abstract size bins (small, normal,
223223
large and xlarge) to be compatible with earlier versions. For example, if you
224224
want to design your UI so that it shows a single-pane UI on phones but a
225-
multi-pane UI on 7" tablets and larger devices, you'd have to supply these
225+
multi-pane UI on 7" tablets, TVs and other large devices, you'd have to supply these
226226
files:</p>
227227

228228
<p><ul>
229229
<li><code>res/layout/main.xml:</code> single-pane layout</li>
230-
<li><code>res/layout-xlarge:</code> multi-pane layout</li>
230+
<li><code>res/layout-large:</code> multi-pane layout</li>
231231
<li><code>res/layout-sw600dp:</code> multi-pane layout</li>
232232
</ul></p>
233233

234234
<p>The last two files are identical, because one of them will be matched by
235-
Android 3.2 devices, and the other one is for the benefit of tablets with
235+
Android 3.2 devices, and the other one is for the benefit of tablets and TVs with
236236
earlier versions of Android.</p>
237237

238-
<p>To avoid this duplication of the same file for tablets (and the maintenance
238+
<p>To avoid this duplication of the same file for tablets and TVs (and the maintenance
239239
headache resulting from it), you can use alias files. For example, you can define the following
240240
layouts:</p>
241241

@@ -247,7 +247,7 @@ layouts:</p>
247247
<p>And add these two files:</p>
248248

249249
<p><ul>
250-
<li><code>res/values-xlarge/layout.xml</code>:
250+
<li><code>res/values-large/layout.xml</code>:
251251
<pre>
252252
&lt;resources>
253253
&lt;item name="main" type="layout">&#64;layout/main_twopanes&lt;/item>
@@ -267,9 +267,9 @@ layouts:</p>
267267

268268
<p>These latter two files have identical content, but they don’t actually define
269269
the layout. They merely set up {@code main} to be an alias to {@code main_twopanes}. Since
270-
these files have <code>xlarge</code> and <code>sw600dp</code> selectors, they are
271-
applied to tablets regardless of Android version (pre-3.2 tablets match
272-
{@code xlarge}, and post-3.2 will match <code>sw600dp</code>).</p>
270+
these files have <code>large</code> and <code>sw600dp</code> selectors, they are
271+
applied to tablets and TVs regardless of Android version (pre-3.2 tablets and TVs match
272+
{@code large}, and post-3.2 will match <code>sw600dp</code>).</p>
273273

274274

275275
<h2 id="TaskUseOriQuali">Use Orientation Qualifiers</h2>
@@ -285,6 +285,7 @@ behaves in each screen size and orientation:</p>
285285
<li><b>7" tablet, landscape:</b> dual pane, wide, with action bar</li>
286286
<li><b>10" tablet, portrait:</b> dual pane, narrow, with action bar</li>
287287
<li><b>10" tablet, landscape:</b> dual pane, wide, with action bar</li>
288+
<li><b>TV, landscape:</b> dual pane, wide, with action bar</li>
288289
</ul></p>
289290

290291
<p>So each of these layouts is defined in an XML file in the
@@ -319,11 +320,11 @@ all}
319320
{@sample development/samples/training/multiscreen/newsreader/res/values-sw600dp-port/layouts.xml
320321
all}
321322

322-
<p><code>res/values-xlarge-land/layouts.xml</code>:</p>
323-
{@sample development/samples/training/multiscreen/newsreader/res/values-xlarge-land/layouts.xml all}
323+
<p><code>res/values-large-land/layouts.xml</code>:</p>
324+
{@sample development/samples/training/multiscreen/newsreader/res/values-large-land/layouts.xml all}
324325

325-
<p><code>res/values-xlarge-port/layouts.xml</code>:</p>
326-
{@sample development/samples/training/multiscreen/newsreader/res/values-xlarge-port/layouts.xml all}
326+
<p><code>res/values-large-port/layouts.xml</code>:</p>
327+
{@sample development/samples/training/multiscreen/newsreader/res/values-large-port/layouts.xml all}
327328

328329

329330

0 commit comments

Comments
 (0)