diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-07-20 14:55:26 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-07-21 15:18:24 -0700 |
commit | 157793dda450b69da388b859d1c1a7a1083c4ec9 (patch) | |
tree | a8d227d6aba5d3bf4a1f4c54ee3ad6daa0d5a1a0 /src/com/android/launcher3/dragndrop | |
parent | 4a44b6e59fc662568a92da36725e940e1dd844db (diff) | |
download | android_packages_apps_Trebuchet-157793dda450b69da388b859d1c1a7a1083c4ec9.tar.gz android_packages_apps_Trebuchet-157793dda450b69da388b859d1c1a7a1083c4ec9.tar.bz2 android_packages_apps_Trebuchet-157793dda450b69da388b859d1c1a7a1083c4ec9.zip |
Increasing the size of the drag icon when a shortcut is dragged
Change-Id: I7d768657300d3229e05d1eb18aec3720a9098ffc
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragController.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragView.java | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index dc93bca72..3447d5148 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -252,8 +252,7 @@ public class DragController implements DragDriver.EventListener, TouchController final float scaleDps = FeatureFlags.LAUNCHER3_LEGACY_WORKSPACE_DND ? res.getDimensionPixelSize(R.dimen.dragViewScale) : 0f; final DragView dragView = mDragObject.dragView = new DragView(mLauncher, b, registrationX, - registrationY, 0, 0, b.getWidth(), b.getHeight(), - initialDragViewScale, scaleDps); + registrationY, initialDragViewScale, scaleDps); mDragObject.dragComplete = false; if (mIsAccessibleDrag) { diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index a5644ad73..e95f07b3c 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -84,13 +84,13 @@ public class DragView extends View { * @param registrationY The y coordinate of the registration point. */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public DragView(Launcher launcher, Bitmap bitmap, int registrationX, int registrationY, int left, - int top, int width, int height, final float initialScale, final float finalScaleDps) { + public DragView(Launcher launcher, Bitmap bitmap, int registrationX, int registrationY, + final float initialScale, final float finalScaleDps) { super(launcher); mDragLayer = launcher.getDragLayer(); mDragController = launcher.getDragController(); - final float scale = (width + finalScaleDps) / width; + final float scale = (bitmap.getWidth() + finalScaleDps) / bitmap.getWidth(); // Set the initial scale to avoid any jumps setScaleX(initialScale); @@ -125,8 +125,8 @@ public class DragView extends View { } }); - mBitmap = Bitmap.createBitmap(bitmap, left, top, width, height); - setDragRegion(new Rect(0, 0, width, height)); + mBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight()); + setDragRegion(new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight())); // The point in our scaled bitmap that the touch events are located mRegistrationX = registrationX; |