diff options
author | Patrick Dubroy <dubroy@google.com> | 2010-07-12 14:25:18 -0700 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2010-07-12 17:29:35 -0700 |
commit | 6569f2c80e179c2f8ed73dae6b01d971ec20f005 (patch) | |
tree | 7663e08de41929b01128176660fd1e5271ea5bb7 /src/com/android/launcher2/WidgetChooser.java | |
parent | 4ab2f860e704b48a721b30095ebbdd353e3c00c4 (diff) | |
download | android_packages_apps_Trebuchet-6569f2c80e179c2f8ed73dae6b01d971ec20f005.tar.gz android_packages_apps_Trebuchet-6569f2c80e179c2f8ed73dae6b01d971ec20f005.tar.bz2 android_packages_apps_Trebuchet-6569f2c80e179c2f8ed73dae6b01d971ec20f005.zip |
When dragging items on the home screen, visualize where they will drop.
Draw a rectangle around the area where an item will land if it is dropped.
If the area is vacant, the rectangle is green; otherwise, it is red.
Change-Id: I859b52514566fa55f8c7a04493b8088d12baa476
Diffstat (limited to 'src/com/android/launcher2/WidgetChooser.java')
-rw-r--r-- | src/com/android/launcher2/WidgetChooser.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher2/WidgetChooser.java b/src/com/android/launcher2/WidgetChooser.java index 4718c6c22..101b671df 100644 --- a/src/com/android/launcher2/WidgetChooser.java +++ b/src/com/android/launcher2/WidgetChooser.java @@ -34,8 +34,11 @@ public class WidgetChooser extends HomeCustomizationItemGallery implements DragS int screenX = mMotionDownRawX - (w / 2); int screenY = mMotionDownRawY - h; - LauncherAppWidgetInfo dragInfo = new LauncherAppWidgetInfo(-1); - dragInfo.providerName = info.provider; + AppWidgetProviderInfo appWidgetInfo = (AppWidgetProviderInfo)view.getTag(); + LauncherAppWidgetInfo dragInfo = new LauncherAppWidgetInfo(info.provider); + // TODO: Is this really the best place to do this? + dragInfo.minWidth = appWidgetInfo.minWidth; + dragInfo.minHeight = appWidgetInfo.minHeight; mDragController.startDrag(bmp, screenX, screenY, 0, 0, w, h, this, dragInfo, DragController.DRAG_ACTION_COPY); return true; |