diff options
author | Joe Onorato <joeo@android.com> | 2009-09-03 09:39:42 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-09-03 09:39:42 -0700 |
commit | 5162ea9b1f41dbebe00fd9ec4d1e15a697971439 (patch) | |
tree | b90250be1d605e207328c0ffc4bb040a8f37f5be /src/com/android/launcher2/DragView.java | |
parent | 6665c0f1fec6ec0962896622986340081df992e7 (diff) | |
download | android_packages_apps_Trebuchet-5162ea9b1f41dbebe00fd9ec4d1e15a697971439.tar.gz android_packages_apps_Trebuchet-5162ea9b1f41dbebe00fd9ec4d1e15a697971439.tar.bz2 android_packages_apps_Trebuchet-5162ea9b1f41dbebe00fd9ec4d1e15a697971439.zip |
Add drag and drop from AllAppsView (to the workspace).
Also had to fix AppInfoCache to load the icon as a drawable, which I had broken
when I made AllAppsView use the icons as power of two textures.
Diffstat (limited to 'src/com/android/launcher2/DragView.java')
-rw-r--r-- | src/com/android/launcher2/DragView.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java index 911a6ce9f..7128ded94 100644 --- a/src/com/android/launcher2/DragView.java +++ b/src/com/android/launcher2/DragView.java @@ -62,22 +62,20 @@ public class DragView extends View implements TweenCallback { * @param registrationX The x coordinate of the registration point. * @param registrationY The y coordinate of the registration point. */ - public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY) { + public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY, + int left, int top, int width, int height) { super(context); mWindowManager = WindowManagerImpl.getDefault(); mTween = new SymmetricalLinearTween(false, 110 /*ms duration*/, this); - int width = bitmap.getWidth(); - int height = bitmap.getHeight(); - Matrix scale = new Matrix(); float scaleFactor = width; scaleFactor = mScale = (scaleFactor + DRAG_SCALE) / scaleFactor; scale.setScale(scaleFactor, scaleFactor); - mBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, scale, true); + mBitmap = Bitmap.createBitmap(bitmap, left, top, width, height, scale, true); // The point in our scaled bitmap that the touch events are located mRegistrationX = registrationX + (DRAG_SCALE / 2); |