summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-05-23 18:26:45 -0700
committerAdam Cohen <adamcohen@google.com>2012-05-23 18:57:49 -0700
commitd024f9845a0974ab525baad085f316031cd5a742 (patch)
treef90a37b45223f0bf3d068d48d35574f6c5f956f3 /src/com/android/launcher2/Workspace.java
parent56734d7e86fdd9c9a012f809d335749511361d55 (diff)
downloadandroid_packages_apps_Trebuchet-d024f9845a0974ab525baad085f316031cd5a742.tar.gz
android_packages_apps_Trebuchet-d024f9845a0974ab525baad085f316031cd5a742.tar.bz2
android_packages_apps_Trebuchet-d024f9845a0974ab525baad085f316031cd5a742.zip
Cleaning up some reordering issues:
-> Reorder solution should never change unless target cell changes -> Simplified code and improved the behaviour when items' jiggle animations switch from one direction to another. These transitions are now seamless and have no more strange delays. Change-Id: I35d70f275d622501851328584bfcb46eec91ff3b
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 047c16c71..f562cbccb 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2770,7 +2770,8 @@ public class Workspace extends SmoothPagedView
ItemInfo info = (ItemInfo) d.dragInfo;
mTargetCell = findNearestArea((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], 1, 1, mDragTargetLayout, mTargetCell);
+ (int) mDragViewVisualCenter[1], item.spanX, item.spanY,
+ mDragTargetLayout, mTargetCell);
setCurrentDropOverCell(mTargetCell[0], mTargetCell[1]);
@@ -2790,11 +2791,6 @@ public class Workspace extends SmoothPagedView
minSpanY = item.minSpanY;
}
- int[] reorderPosition = new int[2];
- reorderPosition = findNearestArea((int) mDragViewVisualCenter[0],
- (int) mDragViewVisualCenter[1], item.spanX, item.spanY, mDragTargetLayout,
- reorderPosition);
-
boolean nearestDropOccupied = mDragTargetLayout.isNearestDropLocationOccupied((int)
mDragViewVisualCenter[0], (int) mDragViewVisualCenter[1], item.spanX,
item.spanY, child, mTargetCell);
@@ -2805,8 +2801,9 @@ public class Workspace extends SmoothPagedView
mTargetCell[0], mTargetCell[1], item.spanX, item.spanY, false,
d.dragView.getDragVisualizeOffset(), d.dragView.getDragRegion());
} else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
- && !mReorderAlarm.alarmPending() && (mLastReorderX != reorderPosition[0] ||
- mLastReorderY != reorderPosition[1])) {
+ && !mReorderAlarm.alarmPending() && (mLastReorderX != mTargetCell[0] ||
+ mLastReorderY != mTargetCell[1])) {
+
// Otherwise, if we aren't adding to or creating a folder and there's no pending
// reorder, then we schedule a reorder
ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,