Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f98f267 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Expand screen documentation with explicit screen size dimensions.

This updates the various documentation on screen sizes to discuss
the exact screen dimensions that are now associated with each size.
In addition, the screen sizes vs. densities table is updated to
include a number of additional representative screens.

Change-Id: Id07491148b1857e0265cef7139e564e190f38e03
parent 7661dd8d
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -57,11 +57,30 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     */
    public boolean userSetLocale;

    /** Constant for {@link #screenLayout}: bits that encode the size. */
    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;
    /** 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;
    /** 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;
    /** 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;
    /** 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_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
     * is wider/taller than normal.  They may be one of
     * {@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;
    
+50 −14
Original line number Diff line number Diff line
@@ -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
its characteristics. </p>


<img src="{@docRoot}images/screens_support/screens-ranges.png" />
<p class="img-caption"><strong>Figure 1.</strong>
Illustration of how the Android platform maps actual screen densities and sizes
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
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.
@@ -212,7 +232,8 @@ of the emulator skins to replicate the characteristics of any specific
screen.</p>

<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>
    <tbody>
@@ -235,27 +256,33 @@ sizes and densities of emulator skins included in the Android SDK.</p>
      <td  style="background-color:#f3f3f3">
        <em>Small</em> screen
      </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 style="font-size:.9em;">480x640</td>
      <td></td>
    </tr>
    <tr>
      <td style="background-color:#f3f3f3">
        <em>Normal</em> screen
      </td>
      <td style="font-size:.9em;">WQVGA400 (240x400)<br>WQVGA432 (240x432)</td>
      <td style="font-size:.9em;">HVGA (320x480)</td>
      <td style="font-size:.9em;">WVGA800 (480x800)<br>WVGA854 (480x854)</td>
      <td style="font-size:.9em;"></td>
      <td style="font-size:.9em;"><strong>WQVGA400 (240x400)</strong>
        <br><strong>WQVGA432 (240x432)</strong></td>
      <td style="font-size:.9em;"><strong>HVGA (320x480)</strong></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>
      <td style="background-color:#f3f3f3">
        <em>Large</em> screen
      </td>
      <td></td>
      <td style="font-size:.9em;">WVGA800* (480x800)<br>WVGA854* (480x854)</td>
      <td style="font-size:.9em;"><strong>WVGA800** (480x800)</strong>
        <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>
    </tr>
@@ -263,10 +290,13 @@ sizes and densities of emulator skins included in the Android SDK.</p>
      <td style="background-color:#f3f3f3">
        <em>Extra Large</em> screen
      </td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td style="font-size:.9em;">600x1024</td>
      <td style="font-size:.9em;">768x1024<br><strong>WXGA (768x1280)</strong>
        <br>800x1280</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>
      <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.
      </td>
    </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>

<p>For an overview of the relative numbers of high (hdpi), medium (mdpi), and
+9 −5
Original line number Diff line number Diff line
@@ -337,21 +337,25 @@ indicates the current locale.</p>
        <li>{@code small}: Screens based on the space available on a
        low-density QVGA screen.  Considering a portrait HVGA display, this has
        the same available width but less height&mdash;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>
        <li>{@code normal}: Screens based on the traditional
        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
        high density.</li>
        <li>{@code large}: Screens based on the space available on a
        medium-density VGA screen.  Such a screen has significantly more
        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>
        <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
large to carry in a pocket and would most likely be tablet-style devices. <em>Added in API Level
9.</em></li>
        medium-density HVGA screen. The minimum layout size for this screen configuration
        is approximately 720x960 dp units.  In most cases, devices with extra large
        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>
        <p><em>Added in API Level 4.</em></p>
        <p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple