summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DragController.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-11-08 14:36:43 -0500
committerJoe Onorato <joeo@android.com>2009-11-08 14:36:43 -0500
commit87467d3a2168180e8d6437d07d22b4dd0ef59845 (patch)
tree30476430f44ffd54a7dc1649158750177d7d0d15 /src/com/android/launcher2/DragController.java
parent511ab64d25ee45518b816afa9110b3160edf3f7b (diff)
downloadandroid_packages_apps_Trebuchet-87467d3a2168180e8d6437d07d22b4dd0ef59845.tar.gz
android_packages_apps_Trebuchet-87467d3a2168180e8d6437d07d22b4dd0ef59845.tar.bz2
android_packages_apps_Trebuchet-87467d3a2168180e8d6437d07d22b4dd0ef59845.zip
Fix 2246713 - Bad offset when picking up a widget for the first time.
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r--src/com/android/launcher2/DragController.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index d4d142458..5eb900718 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -305,6 +305,10 @@ public class DragController {
}
final int action = ev.getAction();
+ if (action == MotionEvent.ACTION_DOWN) {
+ recordScreenSize();
+ }
+
final int screenX = clamp((int)ev.getRawX(), 0, mDisplayMetrics.widthPixels);
final int screenY = clamp((int)ev.getRawY(), 0, mDisplayMetrics.heightPixels);
@@ -316,7 +320,6 @@ public class DragController {
// Remember location of down touch
mMotionDownX = screenX;
mMotionDownY = screenY;
- recordScreenSize();
mLastDropTarget = null;
break;
@@ -351,7 +354,6 @@ public class DragController {
// Remember where the motion event started
mMotionDownX = screenX;
mMotionDownY = screenY;
- recordScreenSize();
if ((screenX < SCROLL_ZONE) || (screenX > scrollView.getWidth() - SCROLL_ZONE)) {
mScrollState = SCROLL_WAITING_IN_ZONE;