diff options
author | Adam Cohen <adamcohen@google.com> | 2013-12-06 16:10:55 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 22:54:21 -0700 |
commit | 000704eb560587f7b301c03c80677c3b3805bcc5 (patch) | |
tree | 883cf385ec937e5ffeb05358cf05f0f6a58ee22e /src/com/android/launcher3/Workspace.java | |
parent | 422308e7ef7897364cdd6e3973fe2574d86c9851 (diff) | |
download | android_packages_apps_Trebuchet-000704eb560587f7b301c03c80677c3b3805bcc5.tar.gz android_packages_apps_Trebuchet-000704eb560587f7b301c03c80677c3b3805bcc5.tar.bz2 android_packages_apps_Trebuchet-000704eb560587f7b301c03c80677c3b3805bcc5.zip |
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
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index a1810802d..64f6a0ccb 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -222,7 +222,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; @@ -2863,7 +2863,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; @@ -3082,7 +3082,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); @@ -3665,6 +3665,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, @@ -3769,7 +3774,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); @@ -3879,7 +3884,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); @@ -3972,7 +3977,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 { |