diff options
author | Roman Nurik <romannurik@google.com> | 2011-12-01 13:42:23 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-01 13:42:23 -0800 |
commit | a7d825dddcb2e8bfd765bad2fb406498f4f1e37e (patch) | |
tree | 806919785c86ea5d51f059c3614a79aad1a9911d /docs | |
parent | 1a1be44c5bf1e6099d678c81ef5e9326cabcb3df (diff) | |
parent | c3998ced746ee97bc5f10a9de1b2848f85c8711e (diff) | |
download | frameworks_base-a7d825dddcb2e8bfd765bad2fb406498f4f1e37e.zip frameworks_base-a7d825dddcb2e8bfd765bad2fb406498f4f1e37e.tar.gz frameworks_base-a7d825dddcb2e8bfd765bad2fb406498f4f1e37e.tar.bz2 |
am c3998ced: Merge "Update widget design guidelines for padding and 8dp." into ics-mr0
* commit 'c3998ced746ee97bc5f10a9de1b2848f85c8711e':
Update widget design guidelines for padding and 8dp.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/guide/practices/ui_guidelines/widget_design.jd | 12 | ||||
-rw-r--r-- | docs/html/guide/topics/appwidgets/index.jd | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/docs/html/guide/practices/ui_guidelines/widget_design.jd b/docs/html/guide/practices/ui_guidelines/widget_design.jd index de20e00..f63f3c4 100644 --- a/docs/html/guide/practices/ui_guidelines/widget_design.jd +++ b/docs/html/guide/practices/ui_guidelines/widget_design.jd @@ -250,13 +250,15 @@ android.widget.FrameLayout}. Just as your activity layouts must adapt to differe sizes, widget layouts must adapt to different Home screen grid cell sizes.</p> <p>Below is an example layout that a music widget showing text information and two buttons can use. -It builds upon the previous discussion of adding margins depending on OS version.</p> +It builds upon the previous discussion of adding margins depending on OS version. Note that the +most robust and resilient way to add margins to the widget is to wrap the widget frame and contents +in a padded {@link android.widget.FrameLayout}.</p> <pre> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_margin="@dimen/widget_margin"> + android:padding="@dimen/widget_margin"> <LinearLayout android:layout_width="match_parent" @@ -295,16 +297,16 @@ use flexible layouts attributes like so:</p> <p>When a user adds the widget to their home screen, on an example Android 4.0 device where each -grid cell is 80dp × 100dp in size and 16dp of margins are automatically applied on all sizes, +grid cell is 80dp × 100dp in size and 8dp of margins are automatically applied on all sizes, the widget will be stretched, like so:</p> <img src="{@docRoot}images/widget_design/music_example_stretched.png" - alt="Music widget sitting on an example 80dp x 100dp grid with 16dp of automatic margins + alt="Music widget sitting on an example 80dp x 100dp grid with 8dp of automatic margins added by the system" id="music_example_stretched"> <p class="img-caption"><strong>Figure 7.</strong> Music widget sitting on an example 80dp x 100dp -grid with 16dp of automatic margins added by the system.</p> +grid with 8dp of automatic margins added by the system.</p> <h2 id="templates">Using the App Widget Templates Pack</h2> diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd index 61337b7..2cb23c1 100644 --- a/docs/html/guide/topics/appwidgets/index.jd +++ b/docs/html/guide/topics/appwidgets/index.jd @@ -346,7 +346,7 @@ following layout classes:</p> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" - <strong>android:layout_margin="@dimen/widget_margin"></strong> + <strong>android:padding="@dimen/widget_margin"></strong> <LinearLayout android:layout_width="match_parent" @@ -363,7 +363,7 @@ following layout classes:</p> <li>Create two dimensions resources, one in <code>res/values/</code> to provide the pre-Android 4.0 custom margins, and one in <code>res/values-v14/</code> to provide no extra padding for Android 4.0 widgets: <p><strong>res/values/dimens.xml</strong>:<br> - <pre><dimen name="widget_margin">15dp</dimen></pre></p> + <pre><dimen name="widget_margin">8dp</dimen></pre></p> <p><strong>res/values-v14/dimens.xml</strong>:<br> <pre><dimen name="widget_margin">0dp</dimen></pre></p> |