diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/appwidget/AppWidgetHostView.java | 24 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 6 |
2 files changed, 17 insertions, 13 deletions
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index d56556f..be6a770 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -244,14 +244,22 @@ public class AppWidgetHostView extends FrameLayout { * * @param newOptions The bundle of options, in addition to the size information, * can be null. - * @param minWidth The minimum width that the widget will be displayed at. - * @param minHeight The maximum height that the widget will be displayed at. - * @param maxWidth The maximum width that the widget will be displayed at. - * @param maxHeight The maximum height that the widget will be displayed at. + * @param minWidth The minimum width in dips that the widget will be displayed at. + * @param minHeight The maximum height in dips that the widget will be displayed at. + * @param maxWidth The maximum width in dips that the widget will be displayed at. + * @param maxHeight The maximum height in dips that the widget will be displayed at. * */ public void updateAppWidgetSize(Bundle newOptions, int minWidth, int minHeight, int maxWidth, int maxHeight) { + updateAppWidgetSize(newOptions, minWidth, minHeight, maxWidth, maxHeight, false); + } + + /** + * @hide + */ + public void updateAppWidgetSize(Bundle newOptions, int minWidth, int minHeight, int maxWidth, + int maxHeight, boolean ignorePadding) { if (newOptions == null) { newOptions = new Bundle(); } @@ -265,10 +273,10 @@ public class AppWidgetHostView extends FrameLayout { int xPaddingDips = (int) ((padding.left + padding.right) / density); int yPaddingDips = (int) ((padding.top + padding.bottom) / density); - int newMinWidth = minWidth - xPaddingDips; - int newMinHeight = minHeight - yPaddingDips; - int newMaxWidth = maxWidth - xPaddingDips; - int newMaxHeight = maxHeight - yPaddingDips; + int newMinWidth = minWidth - (ignorePadding ? 0 : xPaddingDips); + int newMinHeight = minHeight - (ignorePadding ? 0 : yPaddingDips); + int newMaxWidth = maxWidth - (ignorePadding ? 0 : xPaddingDips); + int newMaxHeight = maxHeight - (ignorePadding ? 0 : yPaddingDips); AppWidgetManager widgetManager = AppWidgetManager.getInstance(mContext); diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 3ee3c8c..e5e1a2b 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -1073,11 +1073,7 @@ public class LockPatternUtils { } return appWidgetIds; } - if (appWidgetIdString == null) { - return new int[] { LockPatternUtils.ID_DEFAULT_STATUS_WIDGET }; - } else { - return new int[0]; - } + return new int[0]; } private static String combineStrings(int[] list, String separator) { |