diff options
| author | Adam Cohen <adamcohen@google.com> | 2011-02-25 12:03:37 -0800 |
|---|---|---|
| committer | Adam Cohen <adamcohen@google.com> | 2011-02-25 15:10:40 -0800 |
| commit | d2e20de64b6de8b6391c63e2f5b02ce7698bf4bf (patch) | |
| tree | f8467e4deac16cdb5a8bc1aca57c97e7b1345e3f /core/java/android/appwidget/AppWidgetProviderInfo.java | |
| parent | 0277c171283826dce53cc48e8dd66187051227e4 (diff) | |
Adding framework support for resizable widgets
-> Added resizeMode to the widget xml
-> Fixed an unexposed bug in AppWidgetHost where
minWidth and minHeight were never being converted
from complex type to dp
Change-Id: Ibbc4fc6542d095623ac2a40694b6a3dbfeb279ad
Diffstat (limited to 'core/java/android/appwidget/AppWidgetProviderInfo.java')
| -rw-r--r-- | core/java/android/appwidget/AppWidgetProviderInfo.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java index fe33782f6e2d..32c239755040 100644 --- a/core/java/android/appwidget/AppWidgetProviderInfo.java +++ b/core/java/android/appwidget/AppWidgetProviderInfo.java @@ -25,6 +25,24 @@ import android.content.ComponentName; * correspond to the fields in the <code><appwidget-provider></code> xml tag. */ public class AppWidgetProviderInfo implements Parcelable { + + /** + * Widget is not resizable. + */ + public static final int RESIZE_NONE = 0; + /** + * Widget is resizable in the horizontal axis only. + */ + public static final int RESIZE_HORIZONTAL = 1; + /** + * Widget is resizable in the vertical axis only. + */ + public static final int RESIZE_VERTICAL = 2; + /** + * Widget is resizable in both the horizontal and vertical axes. + */ + public static final int RESIZE_BOTH = RESIZE_HORIZONTAL | RESIZE_VERTICAL; + /** * Identity of this AppWidget component. This component should be a {@link * android.content.BroadcastReceiver}, and it will be sent the AppWidget intents @@ -124,6 +142,13 @@ public class AppWidgetProviderInfo implements Parcelable { */ public int previewImage; + /** + * The rules by which a widget can be resized. See {@link #RESIZE_NONE}, + * {@link #RESIZE_NONE}, {@link #RESIZE_HORIZONTAL}, + * {@link #RESIZE_VERTICAL}, {@link #RESIZE_BOTH}. + */ + public int resizableMode; + public AppWidgetProviderInfo() { } @@ -145,6 +170,7 @@ public class AppWidgetProviderInfo implements Parcelable { this.icon = in.readInt(); this.previewImage = in.readInt(); this.autoAdvanceViewId = in.readInt(); + this.resizableMode = in.readInt(); } public void writeToParcel(android.os.Parcel out, int flags) { @@ -168,6 +194,7 @@ public class AppWidgetProviderInfo implements Parcelable { out.writeInt(this.icon); out.writeInt(this.previewImage); out.writeInt(this.autoAdvanceViewId); + out.writeInt(this.resizableMode); } public int describeContents() { |
