Adding reorder hinting, hopefully will help with (issue 10654628)

-> Adds instant feedback that reorder _will_ happen, so hopefully will
   improve perceived disambiguation

Change-Id: Icd99e7beeb87e79627a6b9fc78a9132781410379
This commit is contained in:
Adam Cohen committed 2013-12-09 18:04:57 -08:00
1 parent 5d518fa77c
commit fa3c58f647
2 files changed
+109 -64

No files matched your search

+11 -6
View File
@@ -216,7 +216,7 @@ public class Workspace extends SmoothPagedView
// Variables relating to the creation of user folders by hovering shortcuts over shortcuts
private static final int FOLDER_CREATION_TIMEOUT = 0;
private static final int REORDER_TIMEOUT = 250;
public static final int REORDER_TIMEOUT = 350;
private final Alarm mFolderCreationAlarm = new Alarm();
private final Alarm mReorderAlarm = new Alarm();
private FolderRingAnimator mDragFolderRingAnimator = null;
@@ -2709,7 +2709,7 @@ public class Workspace extends SmoothPagedView
}
int[] resultSpan = new int[2];
mTargetCell = dropTargetLayout.createArea((int) mDragViewVisualCenter[0],
mTargetCell = dropTargetLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY,
null, mTargetCell, resultSpan, CellLayout.MODE_ACCEPT_DROP);
boolean foundCell = mTargetCell[0] >= 0 && mTargetCell[1] >= 0;
@@ -2935,7 +2935,7 @@ public class Workspace extends SmoothPagedView
}
int[] resultSpan = new int[2];
mTargetCell = dropTargetLayout.createArea((int) mDragViewVisualCenter[0],
mTargetCell = dropTargetLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY, cell,
mTargetCell, resultSpan, CellLayout.MODE_ON_DROP);
@@ -3517,6 +3517,11 @@ public class Workspace extends SmoothPagedView
&& !mReorderAlarm.alarmPending() && (mLastReorderX != reorderX ||
mLastReorderY != reorderY)) {
int[] resultSpan = new int[2];
mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
child, mTargetCell, resultSpan, CellLayout.MODE_SHOW_REORDER_HINT);
// 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,
@@ -3621,7 +3626,7 @@ public class Workspace extends SmoothPagedView
mLastReorderX = mTargetCell[0];
mLastReorderY = mTargetCell[1];
mTargetCell = mDragTargetLayout.createArea((int) mDragViewVisualCenter[0],
mTargetCell = mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, spanX, spanY,
child, mTargetCell, resultSpan, CellLayout.MODE_DRAG_OVER);
@@ -3731,7 +3736,7 @@ public class Workspace extends SmoothPagedView
minSpanY = item.minSpanY;
}
int[] resultSpan = new int[2];
mTargetCell = cellLayout.createArea((int) mDragViewVisualCenter[0],
mTargetCell = cellLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, info.spanX, info.spanY,
null, mTargetCell, resultSpan, CellLayout.MODE_ON_DROP_EXTERNAL);
@@ -3823,7 +3828,7 @@ public class Workspace extends SmoothPagedView
if (touchXY != null) {
// when dragging and dropping, just find the closest free spot
mTargetCell = cellLayout.createArea((int) mDragViewVisualCenter[0],
mTargetCell = cellLayout.performReorder((int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1], 1, 1, 1, 1,
null, mTargetCell, null, CellLayout.MODE_ON_DROP_EXTERNAL);
} else {