summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Katie McCormick <kmccormick@google.com> 2012-09-07 11:06:00 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-09-07 11:06:00 -0700
commitae050d56247257f652fecb71e3f2ed474238e23f (patch)
treec4fdd754b0d29a0c3ca45b206764681ce4d3618f
parent882b267d189bdbab02e44f7fe87c5c55aa04c493 (diff)
parent96ab46039d561213edda37cc2d63dd452bd80fc7 (diff)
Merge "Doc update: Appwidgets JB additions." into jb-dev
-rw-r--r--docs/html/guide/topics/appwidgets/index.jd26
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index a46f9a76f6ee..5a4e03ac8db3 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -307,6 +307,7 @@ following layout classes:</p>
<li>{@link android.widget.FrameLayout}</li>
<li>{@link android.widget.LinearLayout}</li>
<li>{@link android.widget.RelativeLayout}</li>
+ <li>{@link android.widget.GridLayout}</li>
</ul>
<p>And the following widget classes:</p>
@@ -327,6 +328,9 @@ following layout classes:</p>
<p>Descendants of these classes are not supported.</p>
+<p>RemoteViews also supports {@link android.view.ViewStub}, which is an invisible, zero-sized View you can use
+to lazily inflate layout resources at runtime.</p>
+
<h3 id="AddingMargins">Adding margins to App Widgets</h3>
@@ -410,6 +414,25 @@ App Widget,
done.
(See <a href="#Configuring">Creating an App Widget Configuration
Activity</a> below.)</dd>
+
+<dt>
+ {@link android.appwidget.AppWidgetProvider#onAppWidgetOptionsChanged onAppWidgetOptionsChanged()}
+</dt>
+<dd>
+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 />
+<ul>
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_WIDTH}&mdash;Contains
+the lower bound on the current width, in dp units, of a widget instance.</li>
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MIN_HEIGHT}&mdash;Contains
+the lower bound on the current height, in dp units, of a widget instance.</li>
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_WIDTH}&mdash;Contains
+ the upper bound on the current width, in dp units, of a widget instance.</li>
+ <li>{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_MAX_HEIGHT}&mdash;Contains
+the upper bound on the current width, in dp units, of a widget instance.</li>
+</ul>
+
+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.
+</dd>
<dt>{@link android.appwidget.AppWidgetProvider#onDeleted(Context,int[])}</dt>
<dd>This is called every time an App Widget is deleted from the App Widget
host.</dd>
@@ -533,12 +556,13 @@ you would like
to receive the App Widget broadcasts directly, you can implement your own
{@link android.content.BroadcastReceiver} or override the
{@link android.appwidget.AppWidgetProvider#onReceive(Context,Intent)} callback.
-The four Intents you need to care about are:</p>
+The Intents you need to care about are as follows:</p>
<ul>
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_UPDATE}</li>
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DELETED}</li>
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_ENABLED}</li>
<li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_DISABLED}</li>
+ <li>{@link android.appwidget.AppWidgetManager#ACTION_APPWIDGET_OPTIONS_CHANGED}</li>
</ul>