Skip to content

Commit 38ee0da

Browse files
romannurikAndroid (Google) Code Review
authored andcommitted
Merge "docs: Update App Widgets dev guide size discussion" into ics-mr1
2 parents c892e17 + 2b43f3f commit 38ee0da

File tree

1 file changed

+27
-29
lines changed
  • docs/html/guide/topics/appwidgets

1 file changed

+27
-29
lines changed

docs/html/guide/topics/appwidgets/index.jd

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -186,36 +186,34 @@ folder.</p>
186186
<p>Here's a summary of the <code>&lt;appwidget-provider></code> attributes:</p>
187187
<ul>
188188
<li>The values for the <code>minWidth</code> and <code>minHeight</code>
189-
attributes specify the minimum
190-
area required by the App Widget's layout.
191-
<p>The default Home screen positions App Widgets in its window based on a
192-
grid of
193-
cells that have a defined height and width. If the values for an App
194-
Widget's minimum width
195-
or height don't match the dimensions of the cells,
196-
then the App Widget dimensions round <em>up</em> to the nearest cell size.
197-
(See the <a
198-
href="{@docRoot}guide/practices/ui_guidelines/widget_design.html">App Widget
199-
Design
200-
Guidelines</a> for more information on the Home screen cell sizes.)</p>
201-
<p>Because the Home screen's layout orientation (and thus, the cell sizes)
202-
can change,
203-
as a rule of thumb, you should assume the worst-case cell size of 74 pixels
204-
for the height
205-
<em>and</em> width of a cell. However, you must subtract 2 from the final
206-
dimension to account
207-
for any integer rounding errors that occur in the pixel count. To find your
208-
minimum width
209-
and height in density-independent pixels (dp), use this formula:<br/>
210-
<code>(number of cells * 74) - 2</code><br/>
211-
Following this formula, you should use 72 dp for a height of one cell, 294
212-
dp and for a width of four cells.</p>
213-
<p class="note"><strong>Note:</strong> To make your app widget portable across
214-
devices, your app widget's minimum size should never be larger than 4 x 4 cells.
215-
See the <a
216-
href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#sizes">App
217-
Widget Design Guidelines</a> for more discussion of Home screen cell sizes.</p>
189+
attributes specify the minimum amount of space the App Widget consumes
190+
<em>by default</em>. The default Home screen positions App Widgets in its
191+
window based on a grid of cells that have a defined height and width. If
192+
the values for an App Widget's minimum width or height don't match the
193+
dimensions of the cells, then the App Widget dimensions round
194+
<em>up</em> to the nearest cell size.
195+
<p>See the <a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#anatomy_determining_size">
196+
App Widget Design Guidelines</a> for more information on sizing your App
197+
Widgets.</p>
198+
199+
<p class="note"><strong>Note:</strong> To make your app widget portable
200+
across devices, your app widget's minimum size should never be larger
201+
than 4 x 4 cells.</p>
218202
</li>
203+
204+
<li>The <code>minResizeWidth</code> and <code>minResizeHeight</code> attributes
205+
specify the App Widget's absolute minimum size. These values should specify
206+
the size below which the App Widget would be illegible or otherwise unusable.
207+
Using these attributes allows the user to resize the widget to a size that
208+
may be smaller than the default widget size defined by the
209+
<code>minWidth</code> and <code>minHeight</code> attributes.
210+
Introduced in Android 3.1.
211+
212+
<p>See the <a href="{@docRoot}guide/practices/ui_guidelines/widget_design.html#anatomy_determining_size">
213+
App Widget Design Guidelines</a> for more information on sizing your App
214+
Widgets.</p>
215+
</li>
216+
219217
<li>The <code>updatePeriodMillis</code> attribute defines how often the App
220218
Widget framework should request an update from the {@link
221219
android.appwidget.AppWidgetProvider} by calling the

0 commit comments

Comments
 (0)