summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/shortcuts
Commit message (Collapse)AuthorAgeFilesLines
* Refactor shortcuts drag and drop.Tony Wickham2016-09-232-370/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Move shortcut fade interpolator outside of loop.Tony Wickham2016-09-221-2/+5
| | | | Change-Id: I64806897afcd1062dfbaefd6dca07f024f7346af
* Fade deep shorcuts in and out.Tony Wickham2016-09-221-10/+22
| | | | | | | | | | | | | | | | | | | Animate open: - Stagger-fade shortcuts as they open - Become fully opaque before fully open, at which point the arrow animates in (scale). This way there is no overlap of a translucent shortcut over an opaque arrow. Animate close: - Stagger-fade shortcuts as they close - Delay fade until arrow animation is finished, to ensure there is no overlapping of translucent and opaque. This is much less visually jarring when quickly dragging and dropping apps with shortcuts. Bug: 31533078 Change-Id: I8673ee64e92414c718233ea89b70362187e53696
* Merge "When shortcuts close, only set text visible if not in hotseat." into ↵Tony Wickham2016-09-201-1/+4
|\ | | | | | | ub-launcher3-calgary-polish
| * When shortcuts close, only set text visible if not in hotseat.Tony Wickham2016-08-301-2/+4
| | | | | | | | | | | | Bug: 31195155 Change-Id: I3ee6f45f1dd421fcad6ed22b444efd2922b0a32b (cherry picked from commit e53abfa993f94dea119d99221ea5bbdba87303cb)
* | Fix deferred shortcut container removal.Tony Wickham2016-09-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | - Previously, the drag listener listener was removed from the container as soon as it started animating closed, which got rid of its opportunity to complete the deferred removal. - The deferred removal now calls close(), which does further cleanup including updating the app icon's text visibility. Bug: 31248681 Change-Id: I18e545e7e19e50b7d47e23a5beb8f254ba1a4ccf
* | Merge "Some optimizations in blur outline generator" into ↵Sunny Goyal2016-09-021-9/+5
|\ \ | | | | | | | | | ub-launcher3-calgary-polish
| * | Some optimizations in blur outline generatorSunny Goyal2016-09-021-9/+5
| |/ | | | | | | | | | | | | | | | | 1) Using ALPHA_8 as the start and end bitmap. This removes one extra bitmap generation step 2) Using ByteBuffer on ALPHA_8 bitmap for clipAlpha. This allows us to use byteArray instead of intArray for representing pixels Change-Id: I1b654c439fd491b6b91180ddc562bb97fad857aa
* | Fixing topView not being considered in all places when calculating accessibleSunny Goyal2016-09-021-4/+4
| | | | | | | | | | | | | | and focusable views Bug: 30563273 Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
* | Some drag and drop code refactor:Sunny Goyal2016-09-011-3/+4
| | | | | | | | | | | | | | | | | | 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-2/+1
|\ \ | |/ |/| | | ub-launcher3-calgary-polish
| * Support user event logging for drag and dropHyunyoung Song2016-09-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use promisedIntent instead of intent when deep shortcuts are restored.Tony Wickham2016-08-291-3/+3
|/ | | | | | | | | | This ensures that the intent has the package corresponding to the shortcut publisher, rather than a market intent. It also ensures that the intent has the EXTRA_SHORTCUT_ID attached. Bug: 31123204 Change-Id: I05d56396b629880322e915f52bfc0605b921b0b1
* Ignore clicks on shortcuts' drag handles.Tony Wickham2016-08-151-0/+37
|\ | | | | | | | | | | am: e04a07f6ac Change-Id: I96360a63524edeff3e2aa9b21707c1c81a79012f
| * Ignore clicks on shortcuts' drag handles.Tony Wickham2016-08-151-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | When touching down within the drag handle's bounds, we remove the onClickListener temporarily (restored when touching down outside of the drag handle's bounds). Long clicks still start the drag. Also increased drag threshold from 12dp to 16dp. Bug: 30816665 Change-Id: I0b33dc34bf95c0532376f2f7cf50865fa50093de
* | Merge "Moving the shortcut application logic to the DeepShortcutView. This ↵Sunny Goyal2016-08-152-36/+41
|\ \ | | | | | | | | | makes the logic for accessing various properties consistant and and ties it to the UI of the DeepShortcutView." into ub-launcher3-calgary-polish
| * | Moving the shortcut application logic to the DeepShortcutView.Sunny Goyal2016-08-122-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | This makes the logic for accessing various properties consistant and and ties it to the UI of the DeepShortcutView. Bug: 30817556 Change-Id: I09536b9f91b2a9969fcc286f83dd2b17e16cd9ce
* | | Log shortcuts open on ACTION_UP instead of in showForIcon().Tony Wickham2016-08-121-26/+1
|\ \ \ | |/ / |/| | | | | | | | | | | am: be06874c81 Change-Id: Iefc3b03644c2c197f0b744bb9f42fd3058624377
| * | Log shortcuts open on ACTION_UP instead of in showForIcon().Tony Wickham2016-08-101-26/+1
| |/ | | | | | | | | | | | | | | | | | | | | - We only want to log when the container is opened and potentially used, not when a long press is followed by a drag-and-drop. - Also cleaned up code that was determining the container of the app icon, since LaunchSourceProvider.fillInLaunchSourceData() can do that instead (it's more robust and consistent). Bug: 30791570 Change-Id: I05b6750f26182fda8a9940ac66f1371c2d228ca9
* | Reloading workspace when the shortcuts permission changesSunny Goyal2016-08-111-0/+12
|\ \ | | | | | | | | | | | | | | | am: 95f3d6ba2c Change-Id: I90ca9f1380eee4c3e26f929614a1c77b2520b378
| * | Reloading workspace when the shortcuts permission changesSunny Goyal2016-08-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | > Check for permission on every onResume > If the permission is different than last known permission, reload and rebind workspace. Bug: 30789422 Change-Id: Idfa445815e29e2336505779545507d106b33a253
* | | Change drag from shortcuts to say "Cancel" instead of "Remove"Tony Wickham2016-08-091-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | am: df64e9ee06 Change-Id: I27b16b2f526034b50012b65d032098b75f86a754
| * | Change drag from shortcuts to say "Cancel" instead of "Remove"Tony Wickham2016-08-091-1/+1
| |/ | | | | | | | | Bug: 30757836 Change-Id: I7d2d97898bd1feac3cd7ba15614c29a1e1b33841
* / Make padding consistent between shortcuts and the app icon.Tony Wickham2016-08-051-13/+17
|/ | | | | | | | | | | | | This change makes the padding consistent regardless of where the app is (e.g. folder vs workspace vs all apps) by ignoring the app's padding and adding our own to the shortcuts container. Also note that this padding is relative to the icon, excluding the text beneath it. So we also hide the text when the container opens downwards, and re-show it when the container closes. Bug: 30604007 Change-Id: I6e51c4983a8b5d495833f86e483ebaa229ed2099
* Use shortcut disabled message if available.Tony Wickham2016-08-051-0/+4
| | | | | Bug: 30681210 Change-Id: Ibb5fd58e5fc9557b63730bc1e3c3977133769466
* Merge "Start shortcuts close animation where open left off." into ↵Tony Wickham2016-08-032-21/+76
|\ | | | | | | ub-launcher3-calgary
| * Start shortcuts close animation where open left off.Tony Wickham2016-08-022-22/+76
| | | | | | | | | | | | | | | | | | | | | | - Before we always started the close animation at 0 instead of the previous open progress, which looked janky. - Shortened the animations' durations and start delays to account for the fact that the open animation was only partially finished when the close animation started. Bug: 30465231 Change-Id: I958ee5f4543dbf1185f3d0229c55fc1b51929655
* | Updating content description for the shortcuts menu and announcingSunny Goyal2016-08-021-0/+5
| | | | | | | | | | | | | | it when the container is opened Bug: 30587453 Change-Id: I6f2d3ba05593f3e2a1a8f05c66a0f80e76932c38
* | Merge "Always cancel forwarding on ACTION_UP or ACTION_CANCEL." into ↵Tony Wickham2016-08-021-6/+5
|\ \ | | | | | | | | | ub-launcher3-calgary
| * | Always cancel forwarding on ACTION_UP or ACTION_CANCEL.Tony Wickham2016-08-011-6/+5
| |/ | | | | | | | | Bug: 30563284 Change-Id: I6285eda6d9f7a775f8ae896baebc420a0cf84e21
* | Merge "Handling IllegalStateException which can be thrown by the system when ↵Sunny Goyal2016-08-021-5/+5
|\ \ | | | | | | | | | the user is locked" into ub-launcher3-calgary
| * | Handling IllegalStateException which can be thrown by the system when the ↵Sunny Goyal2016-08-011-5/+5
| | | | | | | | | | | | | | | | | | | | | user is locked Bug: 30411561 Change-Id: I0d7fc0aaecba01b1aaac95b98654f6e3ee090ce8
* | | Merge "Add logging for shortcuts opening." into ub-launcher3-calgaryTony Wickham2016-08-021-1/+26
|\ \ \ | |/ / |/| |
| * | Add logging for shortcuts opening.Tony Wickham2016-08-011-1/+26
| |/ | | | | | | | | | | | | | | | | - Log as long press with child type DEEPSHORTCUTS container - Parent type can be one of WORKSPACE, HOTSEAT, FOLDER, ALLAPPS, PREDICTION, or SEARCHRESULT. Bug: 30537079 Change-Id: Ie62e4889ee06c845f959ca998781787a7fdaf00e
* | Merge "Adding quiet mode support for shortcuts" into ub-launcher3-calgarySunny Goyal2016-08-012-4/+18
|\ \ | |/ |/|
| * Adding quiet mode support for shortcutsSunny Goyal2016-07-292-4/+18
| | | | | | | | | | | | | | | | | | | | | | > 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 "Set shortcuts arrow pivot to side connected to container." into ↵Tony Wickham2016-07-301-0/+2
|\ \ | | | | | | | | | ub-launcher3-calgary
| * | Set shortcuts arrow pivot to side connected to container.Tony Wickham2016-07-291-0/+2
| |/ | | | | | | | | Bug: 30508528 Change-Id: Iddc733d79b680010785d21b347d151bc23bffc23
* | Merge "Badging shortcuts with app icons" into ub-launcher3-calgarySunny Goyal2016-07-292-2/+10
|\ \
| * | Badging shortcuts with app iconsSunny Goyal2016-07-292-2/+10
| | | | | | | | | | | | Change-Id: I3fa005ece20a54b31f823acb28c384ecdf1eafb1
* | | Filter shortcuts down to 4 if there are more.Tony Wickham2016-07-292-29/+101
| |/ |/| | | | | | | | | | | | | | | | | | | | | - We take the first 4 in sorted order, except we remove up to 2 static shortcuts to make room for dynamic ones if they exist. - Added ShortcutFilterTest with testSortAndFilterShortcuts(). This asserts that the filtered list is sorted and has the expected number of static and dynamic shortcuts based on inputs with various amounts of each. Bug: 28980830 Change-Id: I832b6b21144f17c74bb8b90a840d6620e99911b8
* | Merge "Prevent opening shortcuts container if one is already open." into ↵Tony Wickham2016-07-291-0/+5
|\ \ | | | | | | | | | ub-launcher3-calgary
| * | Prevent opening shortcuts container if one is already open.Tony Wickham2016-07-271-0/+5
| | | | | | | | | | | | | | | Bug: 30245433 Change-Id: Id50f9e4b9ff40e1d1124caee537a07a594d6a790
* | | Only add shortcuts to the deep shortcut map if they are dynamic/manifest.Tony Wickham2016-07-281-1/+4
| | | | | | | | | | | | | | | Bug: 30475465 Change-Id: I93aff6330b86a3bfa3e6b5741ab759d835618f0b
* | | Merge "Showing the shortcuts in the disabled state and removing ti from the ↵Sunny Goyal2016-07-281-0/+4
|\ \ \ | | | | | | | | | | | | menu when its disabled" into ub-launcher3-calgary
| * | | Showing the shortcuts in the disabled state and removing ti from the menuSunny Goyal2016-07-281-0/+4
| | |/ | |/| | | | | | | | | | | | | | | | when its disabled Bug: 30315906 Change-Id: Ice747e7be955d8bb2dd65191f7613e2afd4abc1c
* / | Stop setting original icon visible when dragging app with shortcuts.Tony Wickham2016-07-281-1/+3
|/ / | | | | | | | | | | | | | | | | - This was leaving a "ghost" icon behind, which looked really weird. - We still need to make it visible for All Apps, or else you can get in a state where the icon is gone from all apps indefinitely. Bug: 30465972 Change-Id: I79eacf2dfdb0cd267732ae63ef69a9bb193933a5
* / Launcher shortcuts animations update.Sunny Goyal2016-07-274-86/+383
|/ | | | | | | | | | | > 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 "Match updated redlines for shortcuts." into ub-launcher3-calgarySunny Goyal2016-07-271-20/+48
|\
| * Match updated redlines for shortcuts.Tony2016-07-261-20/+48
| | | | | | | | | | | | | | | | | | - Align shortcut icons with original icon. - Drag handle is lighter and smaller. - Shortcut pills are slightly wider to accommodate long text. Bug: 28980830 Change-Id: I8e9709e3cbdb9df86a805a4b63a696975c61df5a