summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Ensuring that ShortcutInfo always has an icon" into ub-launcher3-masterSunny Goyal2016-12-161-6/+2
|\
| * Ensuring that ShortcutInfo always has an iconSunny Goyal2016-12-131-6/+2
| | | | | | | | | | | | | | | | | | > Making iconBitmap public instead of a getter (similar to AppInfo) > Removing getIcon() which can lead to IO on UI thread > Removing updateIcon and handling the update at the caller Bug: 21325319 Change-Id: I6a49b9043f974e9629ea25e77012d97cc04c0594
* | Merge "Restore original scaleRectAboutCenter method." into ub-launcher3-masterJonathan Miranda2016-12-151-3/+2
|\ \
| * | Restore original scaleRectAboutCenter method.Jon Miranda2016-12-151-3/+2
| | | | | | | | | | | | Change-Id: Ibb49c56aab29d1223a0ab36476a32d565566eb25
* | | Using java_style enum generation for protoSunny Goyal2016-12-151-9/+9
| | | | | | | | | | | | | | | | | | | | | This makes it easier to track various method parameters and simplifies debug logging Change-Id: Ib7c3d52590d0c36b2c8460c889ee3bead3454569
* | | Removing FeatureFlag.LAUNCHER3_LEGACY_WORKSPACE_DND and corresponding logicSunny Goyal2016-12-151-91/+8
|/ / | | | | | | Change-Id: Ie10c087b4f72ee27be5bf12e2c81be5b7a3a6176
* | Smooth animation when dropping a widget in multi-window mode.Jon Miranda2016-12-141-9/+30
| | | | | | | | | | | | | | | | | | | | Factored in app widget scaling in methods related to estimating widget size and positions. ie. Dropping a widget that needs to be resized to fit in the workspace. Bug: 32176631 Change-Id: I106fe12041565a090047f146a07d4bc80a074b4a
* | Refactoring FlingToDeleteSunny Goyal2016-12-131-16/+0
|/ | | | | | | | | | > 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
* Merge "Move icon back to original cell if a quick drag would cause reorder." ↵Tony Wickham2016-12-121-4/+15
|\ | | | | | | into ub-launcher3-master
| * Move icon back to original cell if a quick drag would cause reorder.Tony Wickham2016-12-071-4/+15
| | | | | | | | | | | | | | | | Most likely the user accidentally dragged the icon, so let's not rearrange their home screen. Bug: 30378199 Change-Id: I815a0817bca3b0d212324a58842b1f59dfdf0b91
* | Merge "Lower the transition threshold for dropping on Workspace." into ↵TreeHugger Robot2016-12-121-3/+12
|\ \ | | | | | | | | | ub-launcher3-master
| * | Lower the transition threshold for dropping on Workspace.Tony Wickham2016-12-121-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old threshold: 0.5f New threshold: 0.25f The threshold is used when dragging to Workspace from any drag source other than Workspace, including Hotseat. This lowered threshold is more forgiving for faster drags. Bug: 33210055 Change-Id: Ic121fb4b7caa3ea66abb48a8a3f3bd36f3365749
* | | Allow long-press on workspace immediately after dropping.Tony Wickham2016-12-121-1/+6
|/ / | | | | | | | | | | | | | | | | | | Previously the touch was consumed until the transition from spring-loaded to normal workspace finished, leading long presses to trigger on the background rather than on apps. This made it difficult to move multiple icons consecutively. Bug: 29631912 Change-Id: I259e618c81f56bc40d08a5d63ddbbf3c82a76baf
* | Merge "Scale widgets when dragging and dropping in multi-window mode." into ↵Jonathan Miranda2016-12-081-7/+7
|\ \ | | | | | | | | | ub-launcher3-master
| * | Scale widgets when dragging and dropping in multi-window mode.Jon Miranda2016-12-081-7/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This change mimics the non-MW mode behavior when dragging and dropping widgets by taking the app widget scale into consideration. This ensures a consistant drag and drop experience between MW mode and non-MW mode. * Uses cell data (cell height/width, spanX/Y) to get the expected widget sizes. * Scales sizes when necessary. Bug: 32176631 Change-Id: Icdaf73ecd89a30e57fe7f405292d793f2d6a3ee8
* / Simplifyling widget inflation and addition flow.Sunny Goyal2016-12-071-33/+27
|/ | | | | | | | | | | | | | > Removing insert parameter used to select the index of the view. ShortcutAndWidgetContainer no longet relies on the index and instead uses x and y to refer a particulat view. > Creating helper methods to easily insert the icon by passing ItemInfo directly. LauncherModel.addItemToDatabase synchronously updates the ItemInfo with proper postion information. So we can directly use the info instead of passing each parameter separately. Bug: 32904959 Change-Id: I021c1b818f2f42604b95a6970e06aacc7211292a
* Fix for mTransitionProgress not being updated throughout animation.Tony Wickham2016-12-061-2/+1
| | | | Change-Id: I8f792794b7bc6edff081383b5a0a74af04a744ad
* Added logging for HOME_INTENT and BACK commands.Jon Miranda2016-11-211-6/+8
| | | | | | Document: go/false-longpress-overview Change-Id: If6ba4996c861a44f4950b41acb4246e3a483d8f2
* Add logging for workspace rearrangement in overview modeHyunyoung Song2016-11-211-1/+1
|\ | | | | | | | | | | am: 0d4899026c Change-Id: Ie6569ecafdd63981e167a910f852a8133697ae81
| * Add logging for workspace rearrangement in overview modeHyunyoung Song2016-11-171-1/+1
| | | | | | | | | | | | b/32457561 Change-Id: Ic38fbd540616a74f26c19a09ab4247fe8f9174b4
| * Merge "Use Launcher.getLauncher(Context) instead of type-casting." into ↵Tony Wickham2016-10-121-1/+1
| |\ | | | | | | | | | ub-launcher3-calgary-polish
* | \ Merge "Moving saving state transtion listener logic to individual views" ↵Sunny Goyal2016-11-181-26/+41
|\ \ \ | | | | | | | | | | | | into ub-launcher3-master
| * | | Moving saving state transtion listener logic to individual viewsSunny Goyal2016-11-141-26/+41
| | | | | | | | | | | | | | | | Change-Id: If5402b6961d7d6be0c50778f27a8746ed6f1bbfb
* | | | Merge "Animate icons back to where they were picked up." into ↵Tony Wickham2016-11-151-1/+17
|\ \ \ \ | |/ / / |/| | | | | | | ub-launcher3-master
| * | | Animate icons back to where they were picked up.Tony Wickham2016-11-021-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Calling buildLayer only on views which are actually visible" into ↵Sunny Goyal2016-11-071-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | ub-launcher3-master
| * | | | Calling buildLayer only on views which are actually visibleSunny Goyal2016-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Creating a common listener for handling buildLayer logic Bug: 30138067 Change-Id: I803ef78b48e07e5ae5922e0392d390f274a87d75
* | | | | Fixing screen center not getting calculated properlySunny Goyal2016-11-011-2/+2
| |/ / / |/| | | | | | | | | | | | | | | Bug: 32578597 Change-Id: Icdf5dc2d82eab3d90b380736d7256ca2d9b2df2e
* | | | Merge "Restore mDragInfo when deferring onDropComplete() for uninstall." ↵Tony Wickham2016-10-271-0/+3
|\ \ \ \ | |/ / / |/| | | | | | | into ub-launcher3-master
| * | | Restore mDragInfo when deferring onDropComplete() for uninstall.Tony Wickham2016-10-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We moved mDragInfo = null to onDragEnd() since onDropComplete() isn't called for pre-drags, but this led to NPE when returning from unistall or app info since onDropComplete() is called after onDragEnd() in this case. So now we restore a copy of mDragInfo. Bug: 32415014 Change-Id: I7ef4fb7145c3c78039af1131e77538969db58141
* | | | Removing custom dispatchDraw logic and letting the system handleSunny Goyal2016-10-261-61/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selecting appropriate children for drawing. > System already skips children which are outside the bounds. Originally this logic was added because workspace layout is larger than the screen, and we need to selectivly skip more children. But over time we have added many special conditions and at present workspace actually draws more children than needed at any given time. > Fixing bug, where onBeginPageMoving was getting called during folder open Bug: 12116740 Change-Id: Idee18ee9cd9d348ebc4dfd82f4ff6df14e0d22d2
* | | | Removing some deprecated code around page layersSunny Goyal2016-10-261-51/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) setChildrenDrawnWithCacheEnabled: deprecated 2) Removing custom logic based on isHardwareAccelerated. This check was not being used consistantly everywhere Bug: 29761236 Change-Id: Ic4a9c764f154497e376e37de2351fe04d1b48500
* | | | Don't move to adjacent page if it is full when dropping on it.Tony Wickham2016-10-241-5/+5
|/ / / | | | | | | | | | | | | Bug: 32003721 Change-Id: Ia81b75a73f510ad2a58764dec9eb7e57b9bf2dcd
* | | Merge "Mark cells as unoccupied in onDragStart instead of startDrag." into ↵Tony Wickham2016-10-191-4/+7
|\ \ \ | | | | | | | | | | | | ub-launcher3-master
| * | | Mark cells as unoccupied in onDragStart instead of startDrag.Tony Wickham2016-10-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also move cleanup (resetting variables to null) to onDragEnd instead of onDropCompleted. These changes are necessary because pre-drags (for apps with shortcuts) don't call onDragStart or onDropCompleted. Bug: 32246571 Change-Id: Ib18fac64555e9158b776f9c12afc2cb807b3c355
* | | | Show error toast messages when there is no room for the item when icon is ↵Jon Miranda2016-10-181-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not to be added to folder. * when user tries to add item to full hot seat from workspace. * when user tries to add item to full home screen from workspace. * refactored so that Workspace handles displaying error messages. Bug: 15574422 Change-Id: Ibc98c7f45bc0c646dc4636660fba62be9db22ac0
* | | | resolve merge conflicts of 2fd0208 to ub-launcher3-masterTony Wickham2016-10-121-1/+1
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| Change-Id: I20ad6eaace81786be080e28d6eb551908add6d90
| * | Use Launcher.getLauncher(Context) instead of type-casting.Tony2016-10-071-1/+1
| | | | | | | | | | | | | | | Bug: 32010039 Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
* | | Announcing the final action when the drag-drop completesSunny Goyal2016-10-111-0/+3
|\ \ \ | | |/ | |/| | | | | | | | | | am: 3f8864069b Change-Id: Iba49c7ba1d1c2d1f4c279970bbcc3ff96af5ccc0
| * | Announcing the final action when the drag-drop completesSunny Goyal2016-10-111-0/+3
| | | | | | | | | | | | | | | Bug:31926812 Change-Id: Id0566cc7dc15732981320807a02fb9cae8a885e6
* | | Refactoring floating view opening/closing logicSunny Goyal2016-10-101-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | > Creating a base view for floating panels with some common methods > Moving the getOpen method to individual classes > Moving the folder icon animation logic to folder icon > Moving all the logic related for opening folder to Folder class Change-Id: I898dfb6870b857cb921d2729b89618bc43ff2e88
* | | Refactors in UserEventDispatcherHyunyoung Song2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | - LaunchSource -> LogContainer Change-Id: I71bfee992fb1ba7ae80e824d419f7bf8d3020999
* | | Code sanitizationHyunyoung Song2016-10-061-17/+17
| | | | | | | | | | | | | | | | | | - Removed bad method/class name typos Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
* | | Add logging for long presses. Reset elapsed timer when changing containers.Jon Miranda2016-10-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is the first CL in a series of logging-related CLs. Upcoming CLs will include using Commands (HOME_INTENT, BACK) and "tapping outside" of a container logic. Change-Id: I62f0a08c7a9d9fce0baa5c12c67e21f63ab16a7c
* | | Update pre-drag lifecycle for apps with shortcuts.Tony Wickham2016-10-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | Consume ACTION_UP when fling is detected on top of iconHyunyoung Song2016-09-301-0/+2
|\| | | | | | | | | | | | | | | | | am: 035a516e18 Change-Id: I0eb8f0c83e1a1611d8bb3b9309d69b8df7c7a19d
| * | Consume ACTION_UP when fling is detected on top of iconHyunyoung Song2016-09-301-0/+2
| |/ | | | | | | | | | | | | Bug: Adam found out that when you swipe down fast on an icon, you can launch search AND launch an app. Only one should trigger and not both. Change-Id: I66b9df26d8bb355f011d057dafd45f90f59b82ae
* | Cleaning up restore instance state logicSunny Goyal2016-09-281-11/+3
| | | | | | | | | | | | | | | | Restore instance state is only used for first binding. But in case of restore, the binding happens synchronously, so there is not need to store the bundle in a global variable Change-Id: Ibc496bcd7c0d171056b8afc69f2c4d9a1270d40c
* | resolve merge conflicts of 6e74e89 to ub-launcher3-masterTony2016-09-231-6/+0
|\| | | | | | | Change-Id: I34e449ca3a91ee06e1983ac3a83cb7ca53567a91
| * Refactor shortcuts drag and drop.Tony Wickham2016-09-231-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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