summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Use Launcher.getLauncher(Context) instead of type-casting." into ↵Tony Wickham2016-10-121-1/+1
|\ | | | | | | ub-launcher3-calgary-polish
| * 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
| | | | | | | | | | Bug:31926812 Change-Id: Id0566cc7dc15732981320807a02fb9cae8a885e6
* | 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
* 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
* Stop jumping to workspace from hotseat on quick drop.Tony Wickham2016-09-201-41/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression occurred in ag/1315317. In that change, Launcher#enterSpringLoadedDragMode() was moved from the end of startDrag() to the end of onDragStart(). This changed the sequence of events from: beginDragShared() --> DragController#startDrag() --> onDragStart --> dropTarget.onDragOver() --> Launcher#enterSpringLoadedDragMode() to: beginDragShared() --> DragController#startDrag() --> onDragStart --> Launcher#enterSpringLoadedDragMode() --> onDragOver() Basically, the key difference is that onDragOver() is called after enterSpringLoadedDragMode(). This matters, because onDragOver() returns early if Workspace#transitionStateShouldAllowDrop() returns false, which it does during the spring loaded transition. This meant that onDragOver() didn't update the layout to be Hotseat, and thus the current workspace page was used as default, since that is what was set in onDragEnter(). To fix it, I've copied the logic in onDragOver() that checks to see if the drag is over the hotseat first to a new method that onDragEnter() now calls as well. Bug: 31245181 Change-Id: Ie758921b25fc96516a09c32bdc9706da941522df
* Fixing issue where overview->normal workspace mode cannot be done by tappingHyunyoung Song2016-09-161-11/+24
| | | | | | | | | | | b/31458165 Because workspaceInModalState makes the VerticalFlingDetector to consume the touch input, click is not detected in Overview mode. Placed pulldown to search behind a feature flag. Change-Id: I31ab69f57944a18e6b264c4f2ed2d0c1175cd940
* Pull down should start search.Hyunyoung Song2016-09-151-3/+17
| | | | | | b/31458165 Change-Id: If4821e3d89a05a00551af6a5209ebc1693a1389b
* Using DragObject for folder drop instead of maintaining states whenSunny Goyal2016-09-091-1/+1
| | | | | | drag starts from inside a folder Change-Id: I073b59c194d0bd483d579bbcb638b116b09590a0
* Fixing topView not being considered in all places when calculating accessibleSunny Goyal2016-09-021-25/+0
| | | | | | | and focusable views Bug: 30563273 Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
* Some drag and drop code refactor:Sunny Goyal2016-09-011-45/+38
| | | | | | | | | 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
* Merge "Support user event logging for drag and drop b/30039490" into ↵Hyunyoung Song2016-09-011-1/+8
|\ | | | | | | ub-launcher3-calgary-polish
| * Support user event logging for drag and dropHyunyoung Song2016-09-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Preventing unnecessary setLayout calls in workspaceSunny Goyal2016-08-301-1/+1
|/ | | | | | Separating getSystemProperty in a separate method Change-Id: I88716e796e29ac27ef25afa41077a8f29eb65f25
* Merge "Moving the state changes during drag-n-drop from startDrag to ↵Sunny Goyal2016-08-161-62/+35
|\ | | | | | | onDragStart" into ub-launcher3-calgary-polish
| * Moving the state changes during drag-n-drop from startDrag to onDragStartSunny Goyal2016-08-151-62/+35
| | | | | | | | | | | | | | This will allow drag controller to optinally defer drag, based on some threshold, by simply deferring the callback onDragStart Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
* | Set launch source target correctly for user event loggingHyunyoung Song2016-08-151-1/+0
|/ | | | | | | Before, everything is set to APP_ICON With this changed, pinned shortcuts are set to DEEPSHORTCUT Change-Id: I3e17de63f58693525236290ef5cb1f909f1d6098
* Adding quiet mode support for shortcutsSunny Goyal2016-07-291-45/+10
| | | | | | | | | | | > 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
* Merge changes I33da0d7f,I36c31609 into ub-launcher3-calgaryWinson Chung2016-07-291-1/+16
|\ | | | | | | | | | | * changes: Working around incorrect wallpaper offsets being calculated in RTL. Fixing RTL wallpaper scrolling.
| * Working around incorrect wallpaper offsets being calculated in RTL.Winson2016-07-281-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When launcher starts up, onCreate() triggers the launcher model loader to start, which calls bindScreens() to add the workspace pages. However, layout does not happen until the device is unlocked, which means that even though the default screen index and children are there the page scrolls are calculated incorrectly, and even in RTL, the page scroll for the 0th screen is zero (it should be at the right most edge of the workspace). This CL works around this by deferring until the first layout after bindScreens() to unlock the wallpaper offset from its default bounds. The workaround is only applied when the launcher activity is first created. Bug: 28795125 Change-Id: I33da0d7f934f5337d26e69f068f579a32897a837
* | Launcher shortcuts animations update.Sunny Goyal2016-07-271-23/+10
|/ | | | | | | | | | | > The shortcut container closes with an animation > When opening/closing the animation only the icon scales and not the title and drag handle > When dragging the icon, it starts from the original icon position and moves under the user finger. The container grows to follow the drag view. Bug: 28980830 Change-Id: Ic0353c30b682d1f018cbf4d62e8a6e8e7d7d4664
* Merge "Fade QSB with the workspace as the overlay enters" into ↵Sunny Goyal2016-07-281-1/+5
|\ | | | | | | ub-launcher3-calgary
| * Fade QSB with the workspace as the overlay entersAdam Cohen2016-07-271-1/+5
| | | | | | | | Change-Id: Iadab9d9f051a85f6772a5d54d38534fcf1b029d7
* | Removing shadow and badging from the icon which is shown in the menuSunny Goyal2016-07-261-11/+11
| | | | | | | | | | | | | | These are added as soon as the icon is added to the workspace Bug: 28980830 Change-Id: I725d2ee8994324f09d9ecf7bbbb0090a7ceb5769
* | Ensure that we update the preview layout rule when not animating.Winson2016-07-251-0/+1
|/ | | | Bug: 28166173 Change-Id: Ibf0245f2dd667216ccabb23a1b279b1801d60cac
* Increasing the size of the drag icon when a shortcut is draggedSunny Goyal2016-07-211-198/+10
| | | | Change-Id: I7d768657300d3229e05d1eb18aec3720a9098ffc
* Optimizing open shortcuts container lookepSunny Goyal2016-07-201-2/+3
| | | | | | findviewById does a DFS, inseat only looking at the first level children Change-Id: Idc028a56648ca026c6022425e3a6e7453fa91986
* Merge "Protecting QSB scroll while transition animation is running." into ↵Sunny Goyal2016-07-201-2/+32
|\ | | | | | | ub-launcher3-calgary
| * Protecting QSB scroll while transition animation is running.Sunny Goyal2016-07-201-4/+32
| | | | | | | | | | | | | | | | | | During transition animation the qorkspace scroll changes while the actual workspace UI is mostly stable. This causes the QSB to animate while the pages are not changing. Bug: 30229069 Change-Id: I66ec41276c0e26164d20da6a5e0e251975390428
* | Initial changes to tweak layout.Winson2016-07-201-13/+5
|/ | | | | | | | | | | | | | | - Adding DeviceProfile callback for when the launcher layout changes due to insets. This is necessary since there are now different layouts depending on which side the navigation bar is on - Consolidating hotseat and other layout into the device profile launcher layout logic - Making the all apps icons match the workspace icon height - Tweaking caret drawable to draw to the bounds specified to simplify layout in each orientation - Fixing minor issue with page indicator shifting in landscape - Centering overview buttons to the workspace page Bug: 30021487 Change-Id: I1866bce00b2948f3edd06168c0f88d81207e3f13
* Remove caret in overview modePeter Schiller2016-07-191-2/+4
| | | | | Bug: 30162951 Change-Id: I71f585e4ae6dfba9dc1d18cd00e45d081cabd4b3
* Adding stateful caret drawablePeter Schiller2016-07-141-1/+0
| | | | Change-Id: Iba30da09f882297f789c405f932fef10617bba89
* Adding a view to indicate space blocked by QSB when QSB is hiddenSunny Goyal2016-07-141-6/+5
| | | | Change-Id: Ifc6b1f2a7312e7919582887ea67bfe900668b70f
* Moving the QSB out of the cell layout to the Drag layerSunny Goyal2016-07-131-23/+81
| | | | | | | | This allows better edge matching for the QSB. The QSB position is kept synchronized with the page scroll and all-apps transition. But its not visible in spring loaded and overview mode Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
* Merge "Adding support for non-zero left insets" into ub-launcher3-calgarySunny Goyal2016-07-091-3/+17
|\
| * Adding support for non-zero left insetsSunny Goyal2016-07-071-3/+17
| | | | | | | | | | Bug: 29613069 Change-Id: Ifdf9bcce7ecdedc510f3be8a4dc10eb8da7c4bf1
* | Updating page indicator content description to indicate click targetSunny Goyal2016-07-081-0/+5
| | | | | | | | | | | | | | for apps list Bug: 29777235 Change-Id: Ia3dc20db7ec06455429389de5752b9bcfff15555
* | Changing isExternalDragWidget to isDragWidget as workspace goes toSunny Goyal2016-07-071-4/+1
|/ | | | | | | modal state even when dragging from workspace Bug: 29900481 Change-Id: I60ce6073b1c06ed19c75a341f9b73f6a147be889
* Merge "Fixing accessibility drag and drop Since the page's accessibility ↵Sunny Goyal2016-07-071-12/+15
|\ | | | | | | flag is updated when entering drag mode, it does not need to be updated on state change" into ub-launcher3-calgary
| * Fixing accessibility drag and dropSunny Goyal2016-07-061-12/+15
| | | | | | | | | | | | | | | | Since the page's accessibility flag is updated when entering drag mode, it does not need to be updated on state change Bug: 29581071 Change-Id: I1a876b4e8530601cb9bf25d097ea37780b525610
* | Second workspace page icons should not show up when all apps is shown in ↵Hyunyoung Song2016-07-061-4/+4
|/ | | | | | | | | | | landscape. b/29931405 > Also some method names to setTranslation -> setTranslationAndAlpha to match its implementation. Change-Id: Icb6ec5df8a267a9024803c70a694ea9b76e5e34d
* Long-press on an app to reveal its shortcuts.Tony Wickham2016-06-291-1/+6
| | | | | | | | | | | | | | | - 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
* Fixing alpha of workspace components being changed at too many placesSunny Goyal2016-06-271-8/+47
| | | | | | | | | | | > Hotseat alpha is changed by all-apps controller, workspaceStateTransition and overlay transition. Created a 3 state alpha for hotseat and pageIndicator > Simplified the page-background and alpha animation during state transition by moving the code in the same if block > Disabling partial page fading when pull-up all apps is enabled. This fixes the bug when pressing home with all-apps opened causes other pages to disappear. Change-Id: I4a75b89af12b48e9fbc49514e641fd424d07199c
* Merge "Accessibility fixes and updates" into ub-launcher3-calgarySunny Goyal2016-06-221-40/+21
|\
| * Accessibility fixes and updatesSunny Goyal2016-06-221-40/+21
| | | | | | | | | | | | | | | | > Adding custom actions on the page indicator to go to overview mode > Disabling custom actions on the first page > Disabling 'move page left' on the second page Change-Id: Ib8154f70cb3f93e663a881357c6c46c33253887f
* | Merge "Add support for launcher shortcuts." into ub-launcher3-calgaryTony Wickham2016-06-221-2/+3
|\ \ | |/ |/|
| * Add support for launcher shortcuts.Tony Wickham2016-06-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This CL has no UI but provides the necessary backing for one. - Adds new item type: ITEM_TYPE_DEEP_SHORTCUT, to distinguish from ITEM_TYPE_SHORTCUT. We can reconsider these names. - Adds ShortcutCache, using LruCache for up to 30 dynamic shortcuts (pinned shortcuts are always cached in a HashMap). - DeepShortcutManager queries for shortcuts and other things like pin them. In a future CL it will use the cache, but for now it simply makes an RPC for all queries. - LauncherModel maintains counts for pinned shortcuts, pinning and unpinning when counts reach 1 or 0, respectively. - LauncherModel maintains a map of components to lists of shortcut ids, which Launcher gets a copy of after it is changed in the background. This will allow us to know how many shortcuts an app has immediately, and query for details as the UI is animating. Change-Id: Ic526f374dd10d72a261bae67f07f098fca8d8bca
* | Maintaining separate alpha for x and y translationsSunny Goyal2016-06-201-17/+38
|/ | | | | Bug: 29504823 Change-Id: I6150fec43653c8da4c5841ddbd6c5de739f205b8
* Moving LauncherAccessibilityDelegate to Launcher to associate it withSunny Goyal2016-06-171-6/+3
| | | | | | activity lifecycle. Change-Id: Ib815505677fa7ed74bdcfe7141b1d9bea5d7143a
* Adding a flag (enabled by default) to remove the all-apps button.Sunny Goyal2016-06-171-2/+2
| | | | | | | All apps can still be opened by clicking the caret. Bug: 29398447 Change-Id: I61f1b05cea83a0a49d7cc16c518c5419618ba779