diff options
author | Tony Wickham <twickham@google.com> | 2016-06-30 12:07:33 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-06-30 16:34:20 -0700 |
commit | 2f2104ccdfd0f47d20e959982c52d36dfc7760ff (patch) | |
tree | 1d181378dec71242ffd14a2a4ff3be1f1e3f4468 /src/com/android/launcher3/dragndrop | |
parent | 5215b545b98a19f2be626d26924af10757da1a76 (diff) | |
download | android_packages_apps_Trebuchet-2f2104ccdfd0f47d20e959982c52d36dfc7760ff.tar.gz android_packages_apps_Trebuchet-2f2104ccdfd0f47d20e959982c52d36dfc7760ff.tar.bz2 android_packages_apps_Trebuchet-2f2104ccdfd0f47d20e959982c52d36dfc7760ff.zip |
Fix some issues with shortcut containers opened inside folders.
- Dragging a shortcut from a container inside a folder was buggy
because the folder assumes that all drags are removing an item
(so it marks the cell as unoccupied, etc.). So we just close
the folder when dragging a shortcut.
- When the shortcuts container opened outside of a folder, touches
on it were incercepted by DragLayer to close the folder. So we
move the container intercept check first, and return false if the
touch is over the container so it can handle the touch.
Change-Id: I8c5814513e99910b2930e05d9a62dfe0a0a60f3e
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragLayer.java | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index aebb1fd10..ce9753666 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -230,6 +230,28 @@ public class DragLayer extends InsettableFrameLayout { } } + // Remove the shortcuts container when touching outside of it. + DeepShortcutsContainer deepShortcutsContainer = (DeepShortcutsContainer) + findViewById(R.id.deep_shortcuts_container); + if (deepShortcutsContainer != null) { + if (isEventOverView(deepShortcutsContainer, ev)) { + // Let the container handle the event. + return false; + } else { + if (isInAccessibleDrag()) { + // Do not close the container if in drag and drop. + if (!isEventOverDropTargetBar(ev)) { + return true; + } + } else { + removeView(deepShortcutsContainer); + // We let touches on the original icon go through so that users can launch + // the app with one tap if they don't find a shortcut they want. + return !isEventOverView(deepShortcutsContainer.getDeferredDragIcon(), ev); + } + } + } + Folder currentFolder = mLauncher.getWorkspace().getOpenFolder(); if (currentFolder != null && intercept) { if (currentFolder.isEditingName()) { @@ -251,25 +273,6 @@ public class DragLayer extends InsettableFrameLayout { } } } - - // Remove the shortcuts container when touching outside of it. - DeepShortcutsContainer deepShortcutsContainer = (DeepShortcutsContainer) - findViewById(R.id.deep_shortcuts_container); - if (deepShortcutsContainer != null) { - if (!isEventOverView(deepShortcutsContainer, ev)) { - if (isInAccessibleDrag()) { - // Do not close the container if in drag and drop. - if (!isEventOverDropTargetBar(ev)) { - return true; - } - } else { - removeView(deepShortcutsContainer); - // We let touches on the original icon go through so that users can launch - // the app with one tap if they don't find a shortcut they want. - return !isEventOverView(deepShortcutsContainer.getDeferredDragIcon(), ev); - } - } - } return false; } |