diff options
author | Adam Cohen <adamcohen@google.com> | 2011-07-19 18:05:33 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-07-19 18:39:40 -0700 |
commit | 1bfaf561b7c09388311f1834f17e057739cf587a (patch) | |
tree | b6571ef2dfca492d6d0f0f56f7acde64d294e37d /core/java/android | |
parent | 588bf7a53e844473dc9be6828a893664935121de (diff) | |
download | frameworks_base-1bfaf561b7c09388311f1834f17e057739cf587a.zip frameworks_base-1bfaf561b7c09388311f1834f17e057739cf587a.tar.gz frameworks_base-1bfaf561b7c09388311f1834f17e057739cf587a.tar.bz2 |
Adding resizeMinWidth/Height to AppWidgetProviderInfo
Change-Id: I17dc27829938a3f25a664d8255965cf9b67cb17e
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/appwidget/AppWidgetHost.java | 4 | ||||
-rw-r--r-- | core/java/android/appwidget/AppWidgetProviderInfo.java | 24 |
2 files changed, 26 insertions, 2 deletions
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java index 8204a4f..08bc0ac 100644 --- a/core/java/android/appwidget/AppWidgetHost.java +++ b/core/java/android/appwidget/AppWidgetHost.java @@ -261,6 +261,10 @@ public class AppWidgetHost { TypedValue.complexToDimensionPixelSize(appWidget.minWidth, mDisplayMetrics); appWidget.minHeight = TypedValue.complexToDimensionPixelSize(appWidget.minHeight, mDisplayMetrics); + appWidget.minResizeWidth = + TypedValue.complexToDimensionPixelSize(appWidget.minResizeWidth, mDisplayMetrics); + appWidget.minResizeHeight = + TypedValue.complexToDimensionPixelSize(appWidget.minResizeHeight, mDisplayMetrics); synchronized (mViews) { v = mViews.get(appWidgetId); diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java index b46802e..b8c5b02 100644 --- a/core/java/android/appwidget/AppWidgetProviderInfo.java +++ b/core/java/android/appwidget/AppWidgetProviderInfo.java @@ -54,7 +54,8 @@ public class AppWidgetProviderInfo implements Parcelable { public ComponentName provider; /** - * Minimum width of the AppWidget, in dp. + * The default height of the widget when added to a host, in dp. The widget will get + * at least this width, and will often be given more, depending on the host. * * <p>This field corresponds to the <code>android:minWidth</code> attribute in * the AppWidget meta-data file. @@ -62,7 +63,8 @@ public class AppWidgetProviderInfo implements Parcelable { public int minWidth; /** - * Minimum height of the AppWidget, in dp. + * The default height of the widget when added to a host, in dp. The widget will get + * at least this height, and will often be given more, depending on the host. * * <p>This field corresponds to the <code>android:minHeight</code> attribute in * the AppWidget meta-data file. @@ -70,6 +72,24 @@ public class AppWidgetProviderInfo implements Parcelable { public int minHeight; /** + * Minimum width (in dp) which the widget can be resized to. This field has no effect if it + * is greater than minWidth or if horizontal resizing isn't enabled (see {@link #resizeMode}). + * + * <p>This field corresponds to the <code>android:minResizeWidth</code> attribute in + * the AppWidget meta-data file. + */ + public int minResizeWidth; + + /** + * Minimum height (in dp) which the widget can be resized to. This field has no effect if it + * is greater than minHeight or if vertical resizing isn't enabled (see {@link #resizeMode}). + * + * <p>This field corresponds to the <code>android:minResizeHeight</code> attribute in + * the AppWidget meta-data file. + */ + public int minResizeHeight; + + /** * How often, in milliseconds, that this AppWidget wants to be updated. * The AppWidget manager may place a limit on how often a AppWidget is updated. * |