am a5b308e7: am 53df89c7: Merge "Expand screen documentation with explicit screen size dimensions." into honeycomb-mr1
* commit 'a5b308e74c44722b9414fa9be52eabacd23029b2': Expand screen documentation with explicit screen size dimensions.
This commit is contained in:
@@ -57,11 +57,30 @@ public final class Configuration implements Parcelable, Comparable<Configuration
|
|||||||
*/
|
*/
|
||||||
public boolean userSetLocale;
|
public boolean userSetLocale;
|
||||||
|
|
||||||
|
/** Constant for {@link #screenLayout}: bits that encode the size. */
|
||||||
public static final int SCREENLAYOUT_SIZE_MASK = 0x0f;
|
public static final int SCREENLAYOUT_SIZE_MASK = 0x0f;
|
||||||
|
/** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK}
|
||||||
|
* value indicating that no size has been set. */
|
||||||
public static final int SCREENLAYOUT_SIZE_UNDEFINED = 0x00;
|
public static final int SCREENLAYOUT_SIZE_UNDEFINED = 0x00;
|
||||||
|
/** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK}
|
||||||
|
* value indicating the screen is at least approximately 320x426 dp units.
|
||||||
|
* See <a href="{@docRoot}guide/practices/screens_support.html">Supporting
|
||||||
|
* Multiple Screens</a> for more information. */
|
||||||
public static final int SCREENLAYOUT_SIZE_SMALL = 0x01;
|
public static final int SCREENLAYOUT_SIZE_SMALL = 0x01;
|
||||||
|
/** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK}
|
||||||
|
* value indicating the screen is at least approximately 320x470 dp units.
|
||||||
|
* See <a href="{@docRoot}guide/practices/screens_support.html">Supporting
|
||||||
|
* Multiple Screens</a> for more information. */
|
||||||
public static final int SCREENLAYOUT_SIZE_NORMAL = 0x02;
|
public static final int SCREENLAYOUT_SIZE_NORMAL = 0x02;
|
||||||
|
/** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK}
|
||||||
|
* value indicating the screen is at least approximately 480x640 dp units.
|
||||||
|
* See <a href="{@docRoot}guide/practices/screens_support.html">Supporting
|
||||||
|
* Multiple Screens</a> for more information. */
|
||||||
public static final int SCREENLAYOUT_SIZE_LARGE = 0x03;
|
public static final int SCREENLAYOUT_SIZE_LARGE = 0x03;
|
||||||
|
/** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK}
|
||||||
|
* value indicating the screen is at least approximately 720x960 dp units.
|
||||||
|
* See <a href="{@docRoot}guide/practices/screens_support.html">Supporting
|
||||||
|
* Multiple Screens</a> for more information.*/
|
||||||
public static final int SCREENLAYOUT_SIZE_XLARGE = 0x04;
|
public static final int SCREENLAYOUT_SIZE_XLARGE = 0x04;
|
||||||
|
|
||||||
public static final int SCREENLAYOUT_LONG_MASK = 0x30;
|
public static final int SCREENLAYOUT_LONG_MASK = 0x30;
|
||||||
@@ -88,6 +107,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration
|
|||||||
* <p>The {@link #SCREENLAYOUT_LONG_MASK} defines whether the screen
|
* <p>The {@link #SCREENLAYOUT_LONG_MASK} defines whether the screen
|
||||||
* is wider/taller than normal. They may be one of
|
* is wider/taller than normal. They may be one of
|
||||||
* {@link #SCREENLAYOUT_LONG_NO} or {@link #SCREENLAYOUT_LONG_YES}.
|
* {@link #SCREENLAYOUT_LONG_NO} or {@link #SCREENLAYOUT_LONG_YES}.
|
||||||
|
*
|
||||||
|
* <p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting
|
||||||
|
* Multiple Screens</a> for more information.
|
||||||
*/
|
*/
|
||||||
public int screenLayout;
|
public int screenLayout;
|
||||||
|
|
||||||
|
|||||||
@@ -189,12 +189,32 @@ offer UI designed for the generalized sizes and densities and let the system
|
|||||||
handle the actual rendering of the UI on the current device screen according to
|
handle the actual rendering of the UI on the current device screen according to
|
||||||
its characteristics. </p>
|
its characteristics. </p>
|
||||||
|
|
||||||
|
|
||||||
<img src="{@docRoot}images/screens_support/screens-ranges.png" />
|
<img src="{@docRoot}images/screens_support/screens-ranges.png" />
|
||||||
<p class="img-caption"><strong>Figure 1.</strong>
|
<p class="img-caption"><strong>Figure 1.</strong>
|
||||||
Illustration of how the Android platform maps actual screen densities and sizes
|
Illustration of how the Android platform maps actual screen densities and sizes
|
||||||
to generalized density and size configurations. </p>
|
to generalized density and size configurations. </p>
|
||||||
|
|
||||||
|
<p>Layout designs often need to be done against a minimum amount of
|
||||||
|
available space, so each screen size bucket has an associated minimum size.
|
||||||
|
These sizes are in "dp" units -- the same units you should use in defining
|
||||||
|
your layouts, which allow us to avoid worrying about changes in screen density.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li> <em>xlarge</em> screens are at least 960dp x 720dp.
|
||||||
|
<li> <em>large</em> screens are at least 640dp x 480dp.
|
||||||
|
<li> <em>normal</em> screens are at least 470dp x 320dp.
|
||||||
|
<li> <em>small</em> screens are at least 426dp x 320dp.
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Note that these minimum screen sizes were not
|
||||||
|
as well defined prior to Android 3.0, so you may encounter some devices
|
||||||
|
that are mis-classified between normal and large. These are also based
|
||||||
|
on the physical resolution of the screen, so may vary across devices --
|
||||||
|
for example a 1024x720 tablet with a system bar would actually have a bit
|
||||||
|
less space available to the application due to it being used by the system
|
||||||
|
bar. Android does not currently support screens smaller than the "small"
|
||||||
|
426dp x 320dp size.</p>
|
||||||
|
|
||||||
<p>Although the platform lets your application provide customized resources for
|
<p>Although the platform lets your application provide customized resources for
|
||||||
the various size and density configurations, you do not need to do write
|
the various size and density configurations, you do not need to do write
|
||||||
custom code or provide custom resources for every combination of screen size and density.
|
custom code or provide custom resources for every combination of screen size and density.
|
||||||
@@ -212,7 +232,8 @@ of the emulator skins to replicate the characteristics of any specific
|
|||||||
screen.</p>
|
screen.</p>
|
||||||
|
|
||||||
<p class="table-caption" id="screens-table"><strong>Table 1.</strong> Screen
|
<p class="table-caption" id="screens-table"><strong>Table 1.</strong> Screen
|
||||||
sizes and densities of emulator skins included in the Android SDK.</p>
|
sizes and densities of emulator skins included in the Android SDK and other
|
||||||
|
representative resolutions.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -235,27 +256,33 @@ sizes and densities of emulator skins included in the Android SDK.</p>
|
|||||||
<td style="background-color:#f3f3f3">
|
<td style="background-color:#f3f3f3">
|
||||||
<em>Small</em> screen
|
<em>Small</em> screen
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size:.9em;">QVGA (240x320)</td>
|
<td style="font-size:.9em;"><strong>QVGA (240x320)</strong></td>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td style="font-size:.9em;">480x640</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="background-color:#f3f3f3">
|
<td style="background-color:#f3f3f3">
|
||||||
<em>Normal</em> screen
|
<em>Normal</em> screen
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size:.9em;">WQVGA400 (240x400)<br>WQVGA432 (240x432)</td>
|
<td style="font-size:.9em;"><strong>WQVGA400 (240x400)</strong>
|
||||||
<td style="font-size:.9em;">HVGA (320x480)</td>
|
<br><strong>WQVGA432 (240x432)</strong></td>
|
||||||
<td style="font-size:.9em;">WVGA800 (480x800)<br>WVGA854 (480x854)</td>
|
<td style="font-size:.9em;"><strong>HVGA (320x480)</strong></td>
|
||||||
<td style="font-size:.9em;"></td>
|
<td style="font-size:.9em;"><strong>WVGA800 (480x800)</strong>
|
||||||
|
<br><strong>WVGA854 (480x854)</strong>
|
||||||
|
<br>600x1024</td>
|
||||||
|
<td style="font-size:.9em;">640x960</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="background-color:#f3f3f3">
|
<td style="background-color:#f3f3f3">
|
||||||
<em>Large</em> screen
|
<em>Large</em> screen
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td style="font-size:.9em;"><strong>WVGA800** (480x800)</strong>
|
||||||
<td style="font-size:.9em;">WVGA800* (480x800)<br>WVGA854* (480x854)</td>
|
<br><strong>WVGA854** (480x854)</strong></td>
|
||||||
|
<td style="font-size:.9em;"><strong>WVGA800* (480x800)</strong>
|
||||||
|
<br><strong>WVGA854* (480x854)</strong>
|
||||||
|
<br>600x1024</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -263,10 +290,13 @@ sizes and densities of emulator skins included in the Android SDK.</p>
|
|||||||
<td style="background-color:#f3f3f3">
|
<td style="background-color:#f3f3f3">
|
||||||
<em>Extra Large</em> screen
|
<em>Extra Large</em> screen
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td style="font-size:.9em;">600x1024</td>
|
||||||
<td></td>
|
<td style="font-size:.9em;">768x1024<br><strong>WXGA (768x1280)</strong>
|
||||||
<td></td>
|
<br>800x1280</td>
|
||||||
<td></td>
|
<td style="font-size:.9em;">1152x1536<br>1152x1920
|
||||||
|
<br>1200x1920</td>
|
||||||
|
<td style="font-size:.9em;">1536x2048<br>1536x2560
|
||||||
|
<br>1600x2560</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" style="border:none;font-size:90%;">* To emulate this
|
<td colspan="4" style="border:none;font-size:90%;">* To emulate this
|
||||||
@@ -274,6 +304,12 @@ sizes and densities of emulator skins included in the Android SDK.</p>
|
|||||||
creating an AVD that uses a WVGA800 or WVGA854 skin.
|
creating an AVD that uses a WVGA800 or WVGA854 skin.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" style="border:none;font-size:90%;">** To emulate this
|
||||||
|
configuration, specify a custom density of 120 when
|
||||||
|
creating an AVD that uses a WVGA800 or WVGA854 skin.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>For an overview of the relative numbers of high (hdpi), medium (mdpi), and
|
<p>For an overview of the relative numbers of high (hdpi), medium (mdpi), and
|
||||||
|
|||||||
@@ -337,21 +337,25 @@ indicates the current locale.</p>
|
|||||||
<li>{@code small}: Screens based on the space available on a
|
<li>{@code small}: Screens based on the space available on a
|
||||||
low-density QVGA screen. Considering a portrait HVGA display, this has
|
low-density QVGA screen. Considering a portrait HVGA display, this has
|
||||||
the same available width but less height—it is 3:4 vs. HVGA's
|
the same available width but less height—it is 3:4 vs. HVGA's
|
||||||
2:3 aspect ratio. Examples are QVGA low density and VGA high
|
2:3 aspect ratio. The minimum layout size for this screen configuration
|
||||||
|
is approximately 320x426 dp units. Examples are QVGA low density and VGA high
|
||||||
density.</li>
|
density.</li>
|
||||||
<li>{@code normal}: Screens based on the traditional
|
<li>{@code normal}: Screens based on the traditional
|
||||||
medium-density HVGA screen. A screen is considered to be normal if it is
|
medium-density HVGA screen. A screen is considered to be normal if it is
|
||||||
at least this size (independent of density) and not larger. Examples
|
at least this size (independent of density) and not larger. The minimum
|
||||||
|
layout size for this screen configuration is approximately 320x470 dp units. Examples
|
||||||
of such screens a WQVGA low density, HVGA medium density, WVGA
|
of such screens a WQVGA low density, HVGA medium density, WVGA
|
||||||
high density.</li>
|
high density.</li>
|
||||||
<li>{@code large}: Screens based on the space available on a
|
<li>{@code large}: Screens based on the space available on a
|
||||||
medium-density VGA screen. Such a screen has significantly more
|
medium-density VGA screen. Such a screen has significantly more
|
||||||
available space in both width and height than an HVGA display.
|
available space in both width and height than an HVGA display.
|
||||||
|
The minimum layout size for this screen configuration is approximately 480x640 dp units.
|
||||||
Examples are VGA and WVGA medium density screens.</li>
|
Examples are VGA and WVGA medium density screens.</li>
|
||||||
<li>{@code xlarge}: Screens that are considerably larger than the traditional
|
<li>{@code xlarge}: Screens that are considerably larger than the traditional
|
||||||
medium-density HVGA screen. In most cases, devices with extra large screens would be too
|
medium-density HVGA screen. The minimum layout size for this screen configuration
|
||||||
large to carry in a pocket and would most likely be tablet-style devices. <em>Added in API Level
|
is approximately 720x960 dp units. In most cases, devices with extra large
|
||||||
9.</em></li>
|
screens would be too large to carry in a pocket and would most likely
|
||||||
|
be tablet-style devices. <em>Added in API Level 9.</em></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><em>Added in API Level 4.</em></p>
|
<p><em>Added in API Level 4.</em></p>
|
||||||
<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
|
<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
|
||||||
|
|||||||
Reference in New Issue
Block a user