diff options
author | Roman Nurik <romannurik@google.com> | 2011-11-29 10:02:19 -0800 |
---|---|---|
committer | Roman Nurik <romannurik@google.com> | 2011-12-01 13:21:14 -0800 |
commit | 061cf70da9ba9f527fdf4f0fa022e91a670f6848 (patch) | |
tree | 39f462f3ad140cef8ca6b3bbcd79ff955147962f /docs/html/guide/practices | |
parent | fe464a76d8fc858be971dbb5e67b1d22fd925347 (diff) | |
download | frameworks_base-061cf70da9ba9f527fdf4f0fa022e91a670f6848.zip frameworks_base-061cf70da9ba9f527fdf4f0fa022e91a670f6848.tar.gz frameworks_base-061cf70da9ba9f527fdf4f0fa022e91a670f6848.tar.bz2 |
Update widget design guidelines for padding and 8dp.
Instead of using layout_margin for widget margins, the recommendation is to
now use padding. Additionally, update all docs to mention an example default
padding of 8dp instead of 15 or 16dp.
Change-Id: I330aedc56986dbb31a70260279ad2f6668c67c92
Diffstat (limited to 'docs/html/guide/practices')
-rw-r--r-- | docs/html/guide/practices/ui_guidelines/widget_design.jd | 12 |
1 files changed, 7 insertions, 5 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> |