diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-08-04 17:27:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-04 17:27:48 +0000 |
commit | 3f7550c1edb2a8db85e2c2db4333c9cd458e259b (patch) | |
tree | ff164823df7275584676132ba72d3fc7a18db0bd /src/com/android/launcher3/Launcher.java | |
parent | c451da705907edaaaef4fdd44f1304872c0b5b0d (diff) | |
parent | 233ee964a9ecf419a3e8330a67456d422879132d (diff) | |
download | android_packages_apps_Trebuchet-3f7550c1edb2a8db85e2c2db4333c9cd458e259b.tar.gz android_packages_apps_Trebuchet-3f7550c1edb2a8db85e2c2db4333c9cd458e259b.tar.bz2 android_packages_apps_Trebuchet-3f7550c1edb2a8db85e2c2db4333c9cd458e259b.zip |
Merge "Calculating widget minSpans and spans statically/independent of orientation > Filtering the widget list and excluding widgets which dont fit the grid > setting minSpans for the widget item when binding." into ub-launcher3-burnaby
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 15e43b2b9..8b2796048 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1553,23 +1553,6 @@ public class Launcher extends Activity } } - private int[] getSpanForWidget(ComponentName component, int minWidth, int minHeight) { - Rect padding = AppWidgetHostView.getDefaultPaddingForWidget(this, component, null); - // We want to account for the extra amount of padding that we are adding to the widget - // to ensure that it gets the full amount of space that it has requested - int requiredWidth = minWidth + padding.left + padding.right; - int requiredHeight = minHeight + padding.top + padding.bottom; - return CellLayout.rectToCell(this, requiredWidth, requiredHeight, null); - } - - public int[] getSpanForWidget(AppWidgetProviderInfo info) { - return getSpanForWidget(info.provider, info.minWidth, info.minHeight); - } - - public int[] getMinSpanForWidget(AppWidgetProviderInfo info) { - return getSpanForWidget(info.provider, info.minResizeWidth, info.minResizeHeight); - } - /** * Add a widget to the workspace. * @@ -2218,7 +2201,7 @@ public class Launcher extends Activity mPendingAddInfo.screenId = -1; mPendingAddInfo.cellX = mPendingAddInfo.cellY = -1; mPendingAddInfo.spanX = mPendingAddInfo.spanY = -1; - mPendingAddInfo.minSpanX = mPendingAddInfo.minSpanY = -1; + mPendingAddInfo.minSpanX = mPendingAddInfo.minSpanY = 1; mPendingAddInfo.dropPos = null; } @@ -3957,6 +3940,8 @@ public class Launcher extends Activity } item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); + item.minSpanX = appWidgetInfo.minSpanX; + item.minSpanY = appWidgetInfo.minSpanY; } else { appWidgetInfo = null; PendingAppWidgetHostView view = new PendingAppWidgetHostView(this, item, |