summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher/DragLayer.java
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:44:05 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:44:05 -0800
commit15a8880cb1b9010ce4503c10c1666568d49415b1 (patch)
tree29fa05cbaa19101da95b010de82290cebfb6d092 /src/com/android/launcher/DragLayer.java
parentbb96f41aa99687260370cf8cdee7683653e538a7 (diff)
downloadandroid_packages_apps_Trebuchet-15a8880cb1b9010ce4503c10c1666568d49415b1.tar.gz
android_packages_apps_Trebuchet-15a8880cb1b9010ce4503c10c1666568d49415b1.tar.bz2
android_packages_apps_Trebuchet-15a8880cb1b9010ce4503c10c1666568d49415b1.zip
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'src/com/android/launcher/DragLayer.java')
-rw-r--r--src/com/android/launcher/DragLayer.java45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/com/android/launcher/DragLayer.java b/src/com/android/launcher/DragLayer.java
index 56140dd07..aa6615a22 100644
--- a/src/com/android/launcher/DragLayer.java
+++ b/src/com/android/launcher/DragLayer.java
@@ -320,40 +320,33 @@ public class DragLayer extends FrameLayout implements DragController {
break;
case MotionEvent.ACTION_MOVE:
- if (Launcher.sOpenGlEnabled) {
- mLastMotionX = x;
- mLastMotionY = y;
+ final int scrollX = mScrollX;
+ final int scrollY = mScrollY;
- invalidate();
- } else {
- final int scrollX = mScrollX;
- final int scrollY = mScrollY;
+ final float touchX = mTouchOffsetX;
+ final float touchY = mTouchOffsetY;
- final float touchX = mTouchOffsetX;
- final float touchY = mTouchOffsetY;
+ final int offsetX = mBitmapOffsetX;
+ final int offsetY = mBitmapOffsetY;
- final int offsetX = mBitmapOffsetX;
- final int offsetY = mBitmapOffsetY;
+ int left = (int) (scrollX + mLastMotionX - touchX - offsetX);
+ int top = (int) (scrollY + mLastMotionY - touchY - offsetY);
- int left = (int) (scrollX + mLastMotionX - touchX - offsetX);
- int top = (int) (scrollY + mLastMotionY - touchY - offsetY);
+ final Bitmap dragBitmap = mDragBitmap;
+ final int width = dragBitmap.getWidth();
+ final int height = dragBitmap.getHeight();
- final Bitmap dragBitmap = mDragBitmap;
- final int width = dragBitmap.getWidth();
- final int height = dragBitmap.getHeight();
+ final Rect rect = mRect;
+ rect.set(left - 1, top - 1, left + width + 1, top + height + 1);
- final Rect rect = mRect;
- rect.set(left - 1, top - 1, left + width + 1, top + height + 1);
-
- mLastMotionX = x;
- mLastMotionY = y;
+ mLastMotionX = x;
+ mLastMotionY = y;
- left = (int) (scrollX + x - touchX - offsetX);
- top = (int) (scrollY + y - touchY - offsetY);
+ left = (int) (scrollX + x - touchX - offsetX);
+ top = (int) (scrollY + y - touchY - offsetY);
- rect.union(left - 1, top - 1, left + width + 1, top + height + 1);
- invalidate(rect);
- }
+ rect.union(left - 1, top - 1, left + width + 1, top + height + 1);
+ invalidate(rect);
final int[] coordinates = mDropCoordinates;
DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);