diff options
author | Adam Cohen <adamcohen@google.com> | 2011-02-18 19:25:06 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-02-25 13:56:06 -0800 |
commit | d4844c3e731b00547a31f23a00f8bd4a271e2b62 (patch) | |
tree | 6efae34aca62c6f2ab8ded7fe832fc765155231a /src/com/android/launcher2/Workspace.java | |
parent | e552b8b19ccdfd724c6b5c5f4f265de00bc1ffac (diff) | |
download | android_packages_apps_Trebuchet-d4844c3e731b00547a31f23a00f8bd4a271e2b62.tar.gz android_packages_apps_Trebuchet-d4844c3e731b00547a31f23a00f8bd4a271e2b62.tar.bz2 android_packages_apps_Trebuchet-d4844c3e731b00547a31f23a00f8bd4a271e2b62.zip |
Implementing resizable widgets in launcher
Change-Id: I18598493dcf34fc6089fa330a4b66803f658b773
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index e7735bec9..bd4b5020d 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -2271,6 +2271,24 @@ public class Workspace extends SmoothPagedView cell.setId(LauncherModel.getCellLayoutChildId(-1, mDragInfo.screen, mTargetCell[0], mTargetCell[1], mDragInfo.spanX, mDragInfo.spanY)); + if (cell instanceof LauncherAppWidgetHostView) { + final CellLayoutChildren children = dropTargetLayout.getChildrenLayout(); + final CellLayout cellLayout = dropTargetLayout; + // We post this call so that the widget has a chance to be placed + // in its final location + + final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell; + AppWidgetProviderInfo pinfo = hostView.getAppWidgetInfo(); + if (pinfo.resizableMode != AppWidgetProviderInfo.RESIZE_NONE) { + post(new Runnable() { + public void run() { + children.addResizeFrame(info, hostView, + cellLayout); + } + }); + } + } + LauncherModel.moveItemInDatabase(mLauncher, info, LauncherSettings.Favorites.CONTAINER_DESKTOP, screen, lp.cellX, lp.cellY); @@ -2309,7 +2327,7 @@ public class Workspace extends SmoothPagedView // would land in a cell occupied by a DragTarget (e.g. a Folder), // then drag events should be handled by that child. - ItemInfo item = (ItemInfo)dragInfo; + ItemInfo item = (ItemInfo) dragInfo; CellLayout currentLayout = getCurrentDropLayout(); int dragPointX, dragPointY; |