@@ -250,13 +250,15 @@ android.widget.FrameLayout}. Just as your activity layouts must adapt to differe
250250sizes, widget layouts must adapt to different Home screen grid cell sizes.</p>
251251
252252<p>Below is an example layout that a music widget showing text information and two buttons can use.
253- It builds upon the previous discussion of adding margins depending on OS version.</p>
253+ It builds upon the previous discussion of adding margins depending on OS version. Note that the
254+ most robust and resilient way to add margins to the widget is to wrap the widget frame and contents
255+ in a padded {@link android.widget.FrameLayout}.</p>
254256
255257<pre>
256258<FrameLayout
257259 android:layout_width="match_parent"
258260 android:layout_height="match_parent"
259- android:layout_margin ="@dimen/widget_margin">
261+ android:padding ="@dimen/widget_margin">
260262
261263 <LinearLayout
262264 android:layout_width="match_parent"
@@ -295,16 +297,16 @@ use flexible layouts attributes like so:</p>
295297
296298
297299<p>When a user adds the widget to their home screen, on an example Android 4.0 device where each
298- grid cell is 80dp × 100dp in size and 16dp of margins are automatically applied on all sizes,
300+ grid cell is 80dp × 100dp in size and 8dp of margins are automatically applied on all sizes,
299301the widget will be stretched, like so:</p>
300302
301303
302304<img src="{@docRoot}images/widget_design/music_example_stretched.png"
303- alt="Music widget sitting on an example 80dp x 100dp grid with 16dp of automatic margins
305+ alt="Music widget sitting on an example 80dp x 100dp grid with 8dp of automatic margins
304306 added by the system" id="music_example_stretched">
305307
306308<p class="img-caption"><strong>Figure 7.</strong> Music widget sitting on an example 80dp x 100dp
307- grid with 16dp of automatic margins added by the system.</p>
309+ grid with 8dp of automatic margins added by the system.</p>
308310
309311
310312<h2 id="templates">Using the App Widget Templates Pack</h2>
0 commit comments