summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop/DragController.java
Commit message (Collapse)AuthorAgeFilesLines
* Increase drag distance threshold when drag starts from deep pressTony Wickham2019-12-241-8/+23
| | | | | | | | | Also don't update distance dragged until drag actually starts (otherwise we add a lot of motion before deep press triggers). Bug: 146146413 Change-Id: I28bd23707a9be53c709d7a4e779e84b9a0be9ce2 (cherry picked from commit a7704c09c70568208f8e08c2d98878e8dd9be1f5)
* Adding debug tracing to catch non-dragging to workspacevadimt2019-08-051-0/+3
| | | | | Bug: 138729456 Change-Id: I28f1eaeb17a75cbc6f52b259d0226deaff42e0bb
* Removing tracing for fixed bugsvadimt2019-07-151-22/+0
| | | | | | | Bug: 133009122 Bug: 133765434 Bug: 134532571 Change-Id: I37aa1851a1bc0874c0b9acf561bde28966e9b523
* More tracing for b/133009122vadimt2019-06-071-0/+11
| | | | | Bug: 133009122 Change-Id: Ic843c3147d8a7513b6e2b8732af18458eae10d63
* Moving TestInformationProvider to Launcher3 so that it can be used forSunny Goyal2019-05-231-6/+7
| | | | | | | | testing Launcher3 without quickstep Also keeping the provider as disabled until needed Change-Id: Ib5f459e02ae551724b390f3b74f43d601568d749
* Adding tracing for a lab-only flakevadimt2019-05-211-0/+12
| | | | | | | | | We had a resolved case in the past where an app's context menu didn't open on a long click (thanks to app updates), now the menu opens, but the drag gesture doesn't drag the icon. Bug: 133009122 Change-Id: I45d104a92fab6556ecd937aef76f0a8147e67f56
* Remove tracing for fixed bugsvadimt2019-05-011-18/+0
| | | | | | Bug: 129434166 Bug: 131170582 Change-Id: Ia9b356594001d96c69ffbb7f8b767b2f54ed5feb
* Cleanup unnecessary override dump methodHyunyoung Song2019-04-251-5/+0
| | | | Change-Id: Ic2909a4d382362ddec9bcc2c738d13120e792fd8
* Add important dump loggingHyunyoung Song2019-04-251-0/+4
| | | | | | | Bug: 130851537 Bug: 119992316 Change-Id: I3de7c1d910d1aecd80b47a85284565c79fe0e2cc
* ShortcutInfo renamed to WorkspaceItemInfoSunny Goyal2019-04-161-2/+2
| | | | | | Will get rid of ShortcutInfoCompat in a follow up cl Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
* Adding tracing for Lab-only flake: drag to workspace doesn't happenvadimt2019-03-271-0/+18
| | | | | Bug: 129434166 Change-Id: I4433a4848b57da42412a9108a0965ff13c708c39
* Add undo snackbar for deleting itemsTony Wickham2018-08-301-1/+1
| | | | | | | | | | | - Add methods to ModelWriter to prepareForUndoDelete, then enqueueDeleteRunnable, followed by commitDelete or abortDelete. - Add Snackbar floating view - Show Undo snackbar when dropping or flinging to delete target; if the undo action is clicked, we abort the delete, otherwise we commit it. Bug: 24238108 Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
* Removing static launcher activity dependency from FirstFrameAnimationHelperSunny Goyal2018-08-131-0/+7
| | | | | | | | Static dependency does not work in the presence of multiple activities and when the main activity is not Launcher (eg in fallback recents). Instead creating FirstFrameAnimatorHelper on demand for individual animations. Change-Id: I17bb69bbaaca92f0db994fb56fd784302c57d543
* Stop DiscoveryBounce when user drags to home from Hotseat in Overview.Tracy Zhou2018-07-231-0/+3
| | | | | | Change-Id: I9f1ba2eef149565e6aab314a4a8376c1cb08cb60 Fixes: 111330609 Test: Manual test
* Fix bug where icon 'jumps' on long press.Jon Miranda2018-05-251-2/+2
| | | | | Bug: 76155869 Change-Id: I739b00564b0ebe00b3aff326b3c1d62deea9d1d3
* Fixing drag and drop statesSunny Goyal2018-03-221-5/+9
| | | | | | | | > Not sending acceptDrop if we are not dragging > Removing workspace scrim in all-apps Bug: 74775232 Change-Id: I5b5354ec249d684ffccd4aacd3c47377cc0eb661
* Simplifying workspace layoutSunny Goyal2017-11-131-8/+11
| | | | | | | | | Instead of creating workspace view larger than the screen size (so that it can be zoomed out), restricting the size to the parent size and bypassing the drag events directly to Workspace (since the workspace is smaller when zoomed out, it might not qualify for all events otherwise). Change-Id: I45e213dd6d16bec5feb6e7cf90bc6f7de4c6d305
* Exposing the state manager directly instead of providing various helper ↵Sunny Goyal2017-10-251-1/+2
| | | | | | | methods for state change Bug: 67678570 Change-Id: If3d05c804c034ffa5e403da8eaa23e85e373c863
* Moving Workspace states into a separate fileSunny Goyal2017-10-181-2/+2
| | | | | Bug: 67678570 Change-Id: I5c63b4df29ca0f58a0223fb1919abc132576a1b6
* Launcher state management cleanupSunny Goyal2017-10-171-2/+3
| | | | | | | | | | > Removing Widgets and related states > Fixing different durations being used when opening/closing all-apps > Removing some unnecessary object allocations when changing state without animation > Differentiating widget bootm sheel and full sheet in logs Bug: 67678570 Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
* Cleaning up drag state management.Sunny Goyal2017-10-161-3/+17
| | | | | | | | | When the drag is started, the UI automatically goes into spring loaded mode. On a successful drop, it is the responsibility of the {@link DropTarget} to exit out of the spring loaded mode. If the drop was cancelled for some reason, the UI will automatically exit out of this mode. Bug: 34692289 Change-Id: Ic611739a43bb8d9279b587aaee3039326c143e8b
* Merging duplicate logic for deferred drop handling in Worksace and FolderSunny Goyal2017-10-061-1/+1
| | | | | | | | > All the logic is contained in UninstallDropTarget > Also fixing a bug were mWaitingForResume was not cleared Bug: 34692289 Change-Id: I617475ce53062902d6817954fb608198e6e03d3c
* Moving some calls off the UI threadSunny Goyal2017-10-021-3/+2
| | | | | | | This saves ~5ms in onNewIntent Bug: 67305604 Change-Id: Ic97727b1c526e50bd3c8a1d8f511e1d7fd5e05e7
* Fixing drag outline not getting drawn when the shortcuts popup is shown.Hyunyoung Song2017-06-261-3/+3
| | | | | | | | | | Shortucts popup uses predrag listener to manage the transient state of the icon. Fixing the order of PredragListener, such that predragEnd gets called before dragStart. This allows the transient state to be cleared before any other state changes are done by onDragStart. Bug: 62544416 Change-Id: I77c9a1aa17a15fe6f9f342af7a7fe3092a9d026b
* Add spring effect to adaptive icon foreground layerHyunyoung Song2017-06-191-1/+1
| | | | | | | | | | | | b/34841763 Note: - Tweaked values with motion designer - icon normalization fix is in - anti aliasing issue is fixed - currently only supported on app icons and not on shortcuts Change-Id: If0e2bd8d49de19c9a81bb0f88b140f170b929934
* Add logging for notifications.Tony Wickham2017-02-071-1/+1
| | | | | | | | | | | | | - Log notification launches - Log notification swipes - Fix logDragNDrop() to only log if the pre-drag ends (so it doesn't log a long-press that only shows shortcuts without dragging). - Add shortcut rank to logs when launching deep shortcuts, where 0 is the shortcut closest to the app icon (highest rank). Bug: 34770729 Bug: 32410600 Change-Id: I99dcef9b6a71da2ef58e32397702bb137407b10f
* Updating the preview generation logic so that it aligns better withSunny Goyal2017-01-271-26/+0
| | | | | | | | | | | | the drag source image > Using common code for pending item drag (WidgetContainerView and PinItemDragListener) > Adding a shortcut-circuit in Workspace when a pendingItem can create a shortcut directly. Previously the multi-window drop was routing through onActivityResult which was causing some state information to be lost. Bug: 33584624 Change-Id: I0259870032185713caa9bff27092dbae6ce91199
* Handing pin item drag when workspce is not loadedSunny Goyal2017-01-251-3/+3
| | | | | | | | While the launcher is loading, the drag view is displayed with a gray tint. The drag is started, as soon as the workspace is unlocked Bug: 33584624 Change-Id: I4013ea8b987ec305e73742b194f9e96af761cc35
* Adding support for drag and drop for requestPinItem.Sunny Goyal2017-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | On long pressing, the confirmation activity starts a system drag-n-drop and focuses the launcher activity. We then drive the launcher drag controller using the system drag event Caveats: > We use a transparent preview for system drag and drop and use a view inside launcher for actual preview. This gives us better control over various animations. > The parameters for drag operation are passed to the Launcher activity using the intent. Since onNewIntent and onDragEvent come at different times and are not associated, a random uuid is used as mime-type to match the drag event with intent params > If the workspace is locked (eg, loader is running) the drag operation is simply dropped. Will be imporved in follow up cls Bug: 33584624 Change-Id: I0bb5b25b690f86b6af31a14e11beb669fcb3a281
* Removing FeatureFlag.LAUNCHER3_LEGACY_WORKSPACE_DND and corresponding logicSunny Goyal2016-12-151-132/+4
| | | | Change-Id: Ie10c087b4f72ee27be5bf12e2c81be5b7a3a6176
* Refactoring FlingToDeleteSunny Goyal2016-12-131-102/+18
| | | | | | | | | | > Moving all fling related logic to FlingToDeleteHelper from DragController > Removing fling related methods from DragSource and DropTarget > Moving fling animation logic from DeleteDropTarget to FlingAnimation > Simplifying DropTargetBar to directly look for all valid drop targets. This makes it easier to add new DropTarget in xml. Change-Id: I7214d2d30c907ab93c80d92d9f9be6dda2d63354
* Animate icons back to where they were picked up.Tony Wickham2016-11-021-10/+19
| | | | | | | | | | | | We do this for pre-dragged icons instead of calling onDrop(). - Removes need for special logic in onDrop() to check if mIsInPreDrag - Dropping from pre-drag in all apps also animates instead of jumping We also do this when dropping an icon while still transitioning to spring-loaded mode, to avoid having a janky jump at the end - Bug: 27135377 Change-Id: I4548c3e2fef3423d1ba36057fb53807b1b4ad0fc
* Code sanitizationHyunyoung Song2016-10-061-3/+3
| | | | | | - Removed bad method/class name typos Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
* Update pre-drag lifecycle for apps with shortcuts.Tony Wickham2016-10-041-31/+46
| | | | | | | | | | | | | | | | - First of all, deferred drag has been renamed to pre-drag to avoid confusion with the existing deferred end drag. - For normal drags, the cycle is still startDrag --> onDragStart --> onDrop --> onDropComplete --> onDragEnd. - Pre-drags have two additional callbacks: onPreDragStart and onPreDragEnd. onPreDragStart is called between startDrag and onDragStart, and onPreDragEnd is called at the same time as onDragStart or onDragEnd. - If the pre-drag has not transitioned to a full drag before onDragEnd, onDragStart and onDropComplete are skipped (onDrop is still called to allow the DragView to animate). Change-Id: Icd7a8f75d5fcc159f9a52758c22ab6eae3edb9e2
* resolve merge conflicts of 6e74e89 to ub-launcher3-masterTony2016-09-231-6/+31
|\ | | | | | | Change-Id: I34e449ca3a91ee06e1983ac3a83cb7ca53567a91
| * Refactor shortcuts drag and drop.Tony Wickham2016-09-231-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Instead of creating our own drag view within the container, and handling logic to determine when to start a real drag, we start the drag immediately and just defer onDragStart(). - To determine when the deferred drag should start, we add a DeferDragCondition to DragOptions. The default DeferDragCondition never defers a drag, but is overridden for apps with shortcuts to defer until the icon is dragged a given distance. - Because the drag is handled in DragController, including checking when to start the deferred drag, DeepShortcutsContainer no longer needs to handle touch events and ShortcutsContainerListener has been removed. This change has several immediate benefits: - The code is much cleaner, because it allows touch handling to be done by the DragController through the normal drag flow, without recreating logic in ShortcutsContainerListener/DeepShortcutContainer. - The janky second haptic feedback has been removed (now it vibrates when you long press, like everywhere else, but not again when the shortcuts close after dragging a distance). - Drops are animated, instead of just popping the icon back into place. Bug: 30769920 Bug: 30465972 Bug: 31533078 Change-Id: I679b412b72fbf6c3895d76963311eb5010c8e8db
* | Resize only one widget at a timeSunny Goyal2016-09-231-2/+2
|/ | | | | | | | | | > Removing logic to have multiple widgets in resize mode > Making ResizeFrame a touch controller, so that it fits well with other touch interaction in drag layer > Chaning the method names in touch controller, so that it do not overlaps with the default View methods Change-Id: I85d4dbdfc82d078781adbce137dfaaea59c9c83d
* Adding support for multiwindow drag and dropSunny Goyal2016-09-121-3/+11
| | | | Change-Id: I95b46e3c3f1238307d3ef5a6c81a8e530ba0987a
* Preventing concurrentmodification exception when dragging a iconSunny Goyal2016-09-071-1/+1
| | | | | | | | | with shortcuts from inside a folder When dragging the icon, DeepShortcutContainer removes itself as a dragListener causing the exception Change-Id: Ifb2b4a3045caa54aa0b6a9b525055ffdcfaa04a6
* Some drag and drop code refactor:Sunny Goyal2016-09-011-50/+21
| | | | | | | | | 1) Adding DragOptions to easily extend drap functionality 2) Changing onDragStarted signature to send more information 3) Updating states for dropTargetButton based on drag event directly 4) Removing folder item based on onDragStarted and not startDrag Change-Id: I65b684e092ddc081d086bfe2c8c1973ed170eaeb
* Support user event logging for drag and dropHyunyoung Song2016-09-011-3/+5
| | | | | | | | | | | | b/30039490 Supported in this CL: - DnD: drag from container [WORKSPACE|HOTSEAT|FOLDER|ALLAPPS|WIDGETS|DEEPSHORTCUTS] drag to container [HOTSEAT,WORKSPACE,FOLDER,DROPTARGETS] - Source and target can be [FOLDER_ICON, ICON, DEEPSHORTCUT, WIDGET] - $ adb shell setprop log.tag.UserEvent DEBUG will turn on debugging Change-Id: I0b8b879b80e6dce85bbde6e7794f9e0677832603
* Adding quiet mode support for shortcutsSunny Goyal2016-07-291-14/+7
| | | | | | | | | | | > LauncherApps returns empty list when the user is locked. Not relying on LauncherApps in this case > When the user is locked, removing all dynamic shortcuts > Loading shortcuts from DB when the user is locked > Verifying the shortcuts again when the user is available Bug: 30411561 Change-Id: Ib6eb372c5b009cadb86a8f6e781f3f3cbf787ceb
* Increasing the size of the drag icon when a shortcut is draggedSunny Goyal2016-07-211-2/+1
| | | | Change-Id: I7d768657300d3229e05d1eb18aec3720a9098ffc
* Long-press on an app to reveal its shortcuts.Tony Wickham2016-06-291-1/+9
| | | | | | | | | | | | | | | - Add ShortcutsContainerListener to icons on workspace, folders, and all apps. This handles long-press and forwards following touches to the DeepShortcutsContainer that is created. - Drag over shortcut before lifting finger to launch it. - Shortcuts are rendered in pill-shaped DeepShortcutViews, which are inside DeepShortcutContainer on DragLayer. - The shortcut container orients above or below the icon, and left or right-aligns with it. Biases for above + left-align. - Long press a DeepShortcutPill to drag and pin it to the workspace. Bug: 28980830 Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
* Pull up all apps interactionHyunyoung Song2016-06-061-1/+2
| | | | | | | | | | | | First phase implementation: dragging and animation interaction is implemented namely in two classes. ScrollGestureDetector and AllAppsTransitionController. FeatureFlag.LAUNCHER#_ALL_APPS_PULL_UP will be true for only AOSP and not in the extending builds. This way, we can safely iterate without turning it on the shipped ready version. b/28917826 Change-Id: I0501309c0121880ffe0555f82d6ac5a145581bb1
* Add distance threshold for dragged items before accepted by targets.Tony Wickham2016-03-291-0/+7
| | | | | | | | | With the new spring-loaded workspace, items are often very close to button drop targets (e.g. App Info) at the start of a drag. This threshold makes it less likely to accidentally drop on a target. Bug: 24099531 Change-Id: I4912ceeb0b63958816177c7bde073e825176d987
* Fixing model being updated on UI threadSunny Goyal2016-03-181-1/+1
| | | | | | | | | | | > When package gets unavailable or suspended, the disabled flag was getting updated on the UI thread. This could lead to inconsistent model if launcher activity didn't exist. > Fixing: When unsuspending one work profile apps, all work profile apps get unsuspended Bug: 27673573,27673373,27403236 Change-Id: I7fde3f79c36204e73ca66ccf8431fa0f0cce3d08
* Tweak spring-loaded workspace.Tony Wickham2016-02-081-4/+4
| | | | | | | | | | | | | - No page indicators in spring-loaded mode - Don’t move workspace up as high - Scale workspace at 90% instead of 80% on phones - Increase speed of workspace -> spring-loaded -> workspace - Widgets were being scaled down twice when dragging from widget picker - Don't scale up icons when dragging (scaling other stuff down is enough) - Make scrim less dark and panels more transparent - Thin white border around page instead of highlight when hovering Change-Id: I963e91c20d4c0340480d165e0f3b8064783c0cb2
* Fixing some invalid checks and cleaning some redundant conditionsSunny Goyal2015-12-181-2/+1
| | | | | | | am: b740f59c7d * commit 'b740f59c7d572d54402e3a74fb2a23c0f1b1af48': Fixing some invalid checks and cleaning some redundant conditions
* Added config_springLoadWorkspace to enable/disable spring-loaded workspace.Tony Wickham2015-12-041-2/+71
| | | | | | | | - Added side hints back - Only scale down icons if spring-loaded - Only show App Info drop target if spring-loaded Change-Id: I4b0dddccbe0e80b7ceb6b7266fc527f757744148