Skip to content

Commit ae050d5

Browse files
labtopiaAndroid (Google) Code Review
authored andcommitted
Merge "Doc update: Appwidgets JB additions." into jb-dev
2 parents 882b267 + 96ab460 commit ae050d5

File tree

1 file changed

+25
-1
lines changed
  • docs/html/guide/topics/appwidgets

1 file changed

+25
-1
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ following layout classes:</p>
307307
<li>{@link android.widget.FrameLayout}</li>
308308
<li>{@link android.widget.LinearLayout}</li>
309309
<li>{@link android.widget.RelativeLayout}</li>
310+
<li>{@link android.widget.GridLayout}</li>
310311
</ul>
311312

312313
<p>And the following widget classes:</p>
@@ -327,6 +328,9 @@ following layout classes:</p>
327328

328329
<p>Descendants of these classes are not supported.</p>
329330

331+
<p>RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use
332+
to lazily inflate layout resources at runtime.</p>
333+
330334

331335
<h3 id="AddingMargins">Adding margins to App Widgets</h3>
332336

@@ -410,6 +414,25 @@ App Widget,
410414
done.
411415
(See <a href="#Configuring">Creating an App Widget Configuration
412416
Activity</a> below.)</dd>
417+
418+
<dt>
419+
{@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()}
420+
</dt>
421+
<dd>
422+
This is called when the widget is first placed and any time the widget is resized. You can use this callback to show or hide content based on the widget's size ranges. You get the size ranges by calling {@link android.appwidget.AppWidgetManager#getAppWidgetOptions getAppWidgetOptions()}, which returns a {@link android.os.Bundle} that includes the following:<br /><br />
423+
<ul>
424+
<li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_WIDTH}&mdash;Contains
425+
the lower bound on the current width, in dp units, of a widget instance.</li>
426+
<li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_HEIGHT}&mdash;Contains
427+
the lower bound on the current height, in dp units, of a widget instance.</li>
428+
<li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_WIDTH}&mdash;Contains
429+
the upper bound on the current width, in dp units, of a widget instance.</li>
430+
<li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_HEIGHT}&mdash;Contains
431+
the upper bound on the current width, in dp units, of a widget instance.</li>
432+
</ul>
433+
434+
This callback was introduced in API Level 16 (Android 4.1). If you implement this callback, make sure that your app doesn't depend on it since it won't be called on older devices.
435+
</dd>
413436
<dt>{@link android.appwidget.AppWidgetProvider#onDeleted(Context,int[])}</dt>
414437
<dd>This is called every time an App Widget is deleted from the App Widget
415438
host.</dd>
@@ -533,12 +556,13 @@ you would like
533556
to receive the App Widget broadcasts directly, you can implement your own
534557
{@link android.content.BroadcastReceiver} or override the
535558
{@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback.
536-
The four Intents you need to care about are:</p>
559+
The Intents you need to care about are as follows:</p>
537560
<ul>
538561
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_UPDATE}</li>
539562
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DELETED}</li>
540563
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_ENABLED}</li>
541564
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DISABLED}</li>
565+
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_OPTIONS_CHANGED}</li>
542566
</ul>
543567

544568

0 commit comments

Comments
 (0)