summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove tracing for fixed bugsvadimt2019-05-011-16/+0
| | | | | | Bug: 129434166 Bug: 131170582 Change-Id: Ia9b356594001d96c69ffbb7f8b767b2f54ed5feb
* Merge "Cleanup unnecessary override dump method" into ub-launcher3-qt-devTreeHugger Robot2019-04-251-5/+0
|\
| * Cleanup unnecessary override dump methodHyunyoung Song2019-04-251-5/+0
| | | | | | | | Change-Id: Ic2909a4d382362ddec9bcc2c738d13120e792fd8
* | Merge "Add important dump logging Bug: 130851537 Bug: 119992316" into ↵Hyunyoung Song2019-04-251-0/+5
|\| | | | | | | ub-launcher3-qt-dev
| * Add important dump loggingHyunyoung Song2019-04-251-0/+5
| | | | | | | | | | | | | | Bug: 130851537 Bug: 119992316 Change-Id: I3de7c1d910d1aecd80b47a85284565c79fe0e2cc
* | Fix NPE / add downX,Y location for all swipes/ add extra debugging infoHyunyoung Song2019-04-241-1/+1
|/ | | | | | | Bug: 122700646 Bug: 127840207 Change-Id: I5862c8950565df172a933114e1fb2f9c4575593e
* Swipe up from nav bar in OVERVIEW or ALL_APPS to go homeTony2019-04-011-2/+3
| | | | | | | | | | | | | | | | | Add NavBarToHomeTouchController, which intercepts touches from the nav bar region when in overview or all apps. Swiping up from all apps translates it up and slightly fades out app icons, then letting go springs towards home screen. Swiping up from overview translates it to the right, then letting go springs towards the left where it lives in the home state. Both cases have a strong deceleration while swiping. Bug: 129571305 Bug: 111926330 Change-Id: I5b7de05f15f0300233343fa2d69fcad624e070f8
* Merge "Fix SwipeDetector positive vs negative for HORIZONTAL direction" into ↵TreeHugger Robot2019-03-281-1/+4
|\ | | | | | | ub-launcher3-master
| * Fix SwipeDetector positive vs negative for HORIZONTAL directionTony2019-03-271-1/+4
| | | | | | | | | | | | | | | | | | Previously left was considered positive and right considered negative. Now left and down are negative, and right and up are positive. For RTL, left is positive and right is negative. Change-Id: Ia31e8c687c8c2716fc632b2fe88aa8955b934bce
* | Merge "Adding tracing for Lab-only flake: drag to workspace doesn't happen" ↵TreeHugger Robot2019-03-281-0/+16
|\ \ | |/ |/| | | into ub-launcher3-master
| * Adding tracing for Lab-only flake: drag to workspace doesn't happenvadimt2019-03-271-0/+16
| | | | | | | | | | Bug: 129434166 Change-Id: I4433a4848b57da42412a9108a0965ff13c708c39
* | Peek overview on motion pause, then animate fully on touch upTony2019-03-271-20/+11
|/ | | | | | | | | | | | | | Add AnimationComponents.ATOMIC_OVERVIEW_PEEK_COMPONENT, and rename previous ATOMIC_COMPONENT to ATOMIC_OVERVIEW_SCALE_COMPONENT. When SWIPE_HOME is enabled: - Overview lives to the left of Workspace, which is encoded in LauncherState.NORMAL.getOverviewScaleAndTranslation(). - Create atomic animation based on ATOMIC_OVERVIEW_PEEK_COMPONENT and OVERVIEW_PEEK state when swiping and holding from home screen. Bug: 111926330 Change-Id: Iab6dbef7238dae15b3036d4b2a026b781eee6b4b
* Sending state ordinals from Launcher to TAPLvadimt2019-02-141-2/+1
| | | | | | | This improves diagnostics. Test: TAPL tests Change-Id: I0ebb533513405372ea7c58a36910160cfb6d8368
* Adding support for swipe and hold to overview from home screen to all-appsSunny Goyal2019-01-281-3/+6
| | | | | | | | | - After the atomic animation ends, overview jumps slightly because the normal -> all apps transition puts it at a different position than normal -> overview Bug: 111926330 Change-Id: I6ca359b3ef2fc4d0b6b96229d8bf118bd0db9649
* Revert "Revert "Add spring to shelf for home <-> overview <-> all apps state ↵Jon Miranda2019-01-081-2/+4
| | | | | | | | | | transitions."" This reverts commit 2bdac8f7e53cb933b84a63799aa6195dd9486b8d. Reason for revert: Reverting and added fix to crash Change-Id: I20508eb05c85ba5dfba52630aa9becea270f890b
* Revert "Add spring to shelf for home <-> overview <-> all apps state ↵Jonathan Miranda2019-01-051-4/+2
| | | | | | | | | | transitions." This reverts commit e018711aac98522f2b24cb01cd95e17125aaf178. Reason for revert: investigating crash Change-Id: I157b61a9f1bd46e2fcd3f2f883d3b5c23ca314af
* Add spring to shelf for home <-> overview <-> all apps state transitions.Jon Miranda2019-01-041-2/+4
| | | | | | | | | | | Added new SpringObjectAnimator class that wraps an ObjectAnimator so the Object can be controlled via the Animator or via a SpringAnimation. It extends ValueAnimator so that it remains compatible with AnimatorPlaybackController. Code is behind feature flag toggle QUICKSTEP_SPRINGS. Bug: 111698021 Change-Id: I1b20179ede37e89a6a6bb2a45d407cc74c99ac4e
* Fix end state when animating launcher after swipe up from an appTony2018-11-291-2/+1
| | | | | | | | Previously we were comparing the controller's progress at the time of the end of the animation... which is always 1. Instead, we should be comparing the effective final progress based on the interpolator. Change-Id: I18110b5a3b914839860931187f39cfa11182b3e2
* Merge "Using velocity tracker for computing the velocity of motion events" ↵Sunny Goyal2018-09-251-1/+1
|\ | | | | | | into ub-launcher3-master
| * Using velocity tracker for computing the velocity of motion eventsSunny Goyal2018-09-131-1/+1
| | | | | | | | Change-Id: I14f2f970825a2936f4bb285834405d67daf8667c
* | Swipe down on status barHyunyoung Song2018-09-181-1/+1
|/ | | | | | Bug: 111839343 Change-Id: I5332dc098af980b4d4ef45b095586d68975ad98c
* Sharing protocol constants between Launcher and TAPLVadim Tryshev2018-08-141-1/+3
| | | | | | Bug: 110103162 Test: TaplTests Change-Id: I5b2a2b8576a7a6ea4a156f00858711496d6b5bba
* Tapl libraryVadim Tryshev2018-07-201-0/+3
| | | | | | | | | The public API of the library has finalized; flakiness has been removed; code polished. Bug: 110103162 Test: TaplTests suite Change-Id: Ic156bbfeedb1cb9c4a48ef907f97e396e8e81936
* When controlling atomic components, bound to remaining progressTony Wickham2018-06-211-1/+3
| | | | | | | | | | | | | Before, we were just controlling the components as far as we had left, which was fine since they are just a subtle effect anyway. But now that we don't fade out until the very end, this means that long swiping from home usually kept recents in the background during the entire swipe and then abruptly disappear after letting go. Now we make sure the entire atomic animation plays by the time we reach all apps, so recents will fade out in all cases. Bug: 79867407 Change-Id: I7cb6790d9055bc76b4b73ed761604042a308c987
* Merge "Adjust interpolators when swiping from overview to all apps" into ↵Jonathan Miranda2018-06-211-1/+6
|\ | | | | | | ub-launcher3-edmonton-polish
| * Adjust interpolators when swiping from overview to all appsTony Wickham2018-06-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | - All apps content fades in quickly so that icons are opaque by the time they are on screen - Recents fades out late so that we don't see it as translucent while the transition is continuing (the translucent icon top of tranclucent task view looks bad, for instance) - Fix colored scrim that appears over recents - was using 0 to 1 instead of 255 Bug: 79867407 Change-Id: I4f50423157f7870c8d0708f586a72e3e5a7b6559
* | Merge "Don't intercept above shelf progress if still animating" into ↵Tony Wickham2018-06-191-1/+1
|\ \ | |/ |/| | | ub-launcher3-edmonton-polish
| * Don't intercept above shelf progress if still animatingTony2018-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | When you swipe up to overview from home, we should allow touches on recents even if the overshoot animation isn't finished. If the touch is below the all apps progress, we continue to intercept to allow for double swipe up. Bug: 80093992 Change-Id: Ifdca61e7cfc1f7a713c067596cc0c1bd3154b44e
* | Fixing atomic animation not getting completed properlySunny Goyal2018-06-121-17/+48
| | | | | | | | | | | | | | | | | | | | | | > Finishing the atomic animation to that proper states are applied > Offsetting the duration of atomic animation so that it completes along with the swipe animation Bug: 80432882 Bug: 86308723 Bug: 80549582 Change-Id: I8a3b44c2c7017e241b2fbdbb96c5d67edbb359d1
* | Fix some issues with hapticTony Wickham2018-06-111-1/+3
| | | | | | | | | | | | | | | | | | | | - Don't have double haptic on quick scrub - Correctly check interpolated progress to determine final state, so that it always aligns with the haptic (i.e. passing the haptic means letting go will go to the new state) Bug: 109709720 Change-Id: I702bb76a4c15f932f923e81a14cc49f6a9126cb8
* | Added haptic feedback when swipe/fling up from an app in fullscreenMatthew Ng2018-06-111-1/+1
|/ | | | | | | | | This includes swiping/fling up from a fullscreen app and swiping/fling down a task to a fullscreen app. Test: swipe up when app is fullscreen Fixes: 80543530 Change-Id: Iee259284cc6d4fe1e784532f0822ffd38cdee280
* Fixing controller state is not properly cleared when the animaiton is cancelled.Sunny Goyal2018-06-051-17/+43
| | | | | | | | | | | | | | | | This was leading to a pending animation running while the state had changes, leaving user in an inconsistent state. Various atomic animation fixes > Ensuring that there is only one success listener on atomic animation, so that atomic controller is created only once and to the final mToState > If atomic controller is already running, skip animating the atomic conmonenets as part of main animaiton > Cancel atomic controller if it is going to a different state Bug: 80549582 Bug: 109583168 Change-Id: Ie7a032e0fa73b1f1c2ef53055c08d16444f0385e
* Only log swipe interaction on swipe endTony Wickham2018-05-231-22/+16
| | | | | | | | Previously we were logging new states as we swipe past them; now we just log the start and end states when lifting your finger. Bug: 80102083 Change-Id: Icec6c3dab1441023a3cdcadb7b56ecef8313cb8c
* Merge "Add mStartState to determine if user swipes up from Home." into ↵TreeHugger Robot2018-05-231-1/+4
|\ | | | | | | ub-launcher3-edmonton
| * Add mStartState to determine if user swipes up from Home.Tracy Zhou2018-05-221-1/+4
| | | | | | | | | | | | Bug: 80146880 Test: Manual test Change-Id: Ia0743bff3f2a5b3998a798743138b012ec461a94
* | Start springs for All Apps when user flings up.Jon Miranda2018-05-231-0/+3
| | | | | | | | | | Bug: 77695481 Change-Id: Ifecfbbb89601947118f620f522662aee8a61946e
* | Cleanup how we set back button alphaTony Wickham2018-05-221-12/+0
|/ | | | | | | | | Add BackButtonAlphaHandler to set back button alpha, instead of setting it from multiple places. Also force back button alpha to be 1 if swipe up is disabled (b/80091187) Change-Id: I49b63a0e6b033a3a947a847669a398f1b9ff0564
* Merge "Fix a couple issues with swiping up from home" into ub-launcher3-edmontonTony Wickham2018-05-181-5/+7
|\
| * Fix a couple issues with swiping up from homeTony Wickham2018-05-171-5/+7
| | | | | | | | | | | | | | | | | | - Don't update the animation to go from 0 to 1; instead, update the interpolator to clamp to the remaining progress (b/79773309) - Fix NPE that can happen in a race between the atomic animation ending and the non-atomic animation canceling/ending Change-Id: I313251dc5cbd7b931b043fc3e840bb4ab368a790
* | Fade back button in and out tied with the overview/shelf (2/3)Matthew Ng2018-05-181-0/+12
|/ | | | | | | | | | | | | | Back button changes opacity when moving the shelf during swipe up between home screen and overview. The alpha changes depending on the progress of the swipe up animation. When going from app to home and vice versa, the fade animation does not tie with the swipe up progress. The fade animation also masks the back button drawable when ime visibility changes. Change-Id: I51e42930640ba711e81880b385bb722d7ee8ad33 Fixes: 74581837 Fixes: 76900236 Test: swipe up from home screen to overview
* Update interpolators and durations for state animationsTony Wickham2018-05-161-8/+8
| | | | | | | | | | | | | | | | | | | When we enter overview (overview appears, workspace disappears): - Workspace scales down from 1f to .8f with OvershootInterpolator(1.2f) at 200 ms - Workspace fades from 1f to 0 with OvershootInterpolator(1.2f) at 200 ms - Overview scales down from 1.33f to 1f with OvershootInterpolator(1.2f) at 200 ms - Overview fades from 0 to 1f with OvershootInterpolator(1.2f) at 200 ms When we exit overview (overview disappears, workspace appears): - Workspace scales up from .92f to .1f with DecelerateInterpolator() at 200 ms - Workspace fades from 0 to 1f with AccelerateInterpolator() at 200 ms - Overview scales up from 1f to 1.1f with AccelerateInterpolator() at 180ms - Overview fades from 1f to 0 with DecelerateInterpolator(1.7f) at 200 ms Parallax while the finger moves: Workspace translates half the distance as the shelf Bug: 79776746 Change-Id: I319d982cf202bcd6dbbcd68ffc5c0c7853629c7e
* Make fling thresholds consistentTony Wickham2018-05-161-10/+19
| | | | | | | | | | | | | | | | | | There are 3 places we can block a fling: - Swiping from home to all apps (through overview) - Swiping from an app to all apps (through overview) - Dismissing a task (in the same gesture that started by swiping down) In all of these cases, we block the fling when crossing the threshold to a new state (e.g. OVERVIEW), but unblock if the user pauses their drag. With this change, the logic is consistent: - Unblock the fling after pausing a short amount of time - If a fling was blocked, increase the settling duration based on velocity Bug: 78089840 Bug: 78658678 Change-Id: I5ef52b74229418b867b26c3c6d3db2cf6e48914b
* Don't end atomic animation when passing through stateTony Wickham2018-05-091-15/+88
| | | | | | | | | | | | | | | | | | Previously we were ending the atomic animation with the assumption that it should be complete/almost complete by the time you drag to the next state. However, it is very easy to drag quickly enough where that assumption doesn't hold, and thus you just see the atomic animation pop to the end (i.e. recents showing without animation). Now instead of ending the atomic animation, we let it continue. But because the new state animation will have an atomic component that interferes with the still playing atomic animation, we have to control the atomic component separately; we control the non-atomic components until the atomic animation ends, at which point we create a separate controller to control the atomic components. Bug: 76449024 Change-Id: Ia4bf19e26d0838f952d9e500fbdd8aba19856a41
* Add atomic recents animation while swiping upTony Wickham2018-05-091-14/+113
| | | | | | | | | | | | | | | | | | | | | State handlers can now specify atomic and non-atomic components of their animations to states, which can be specified when creating a new animation. There is now one atomic animation, when going from NORMAL to OVERVIEW (and in reverse): - RecentsViewStateController's animation (scale/alpha) is all atomic - WorkspaceStateTransitionAnimation has atomic and non-atomic: - Hotseat and workspace alpha is atomic, as is workspace scale - Everything else (scrim, translation, qsb and drag handle alpha) is non-atomic - All apps progress is non-atomic Also simplified dragging through overview; no longer pulls against you, so we use an OvershootInterpolator when flinging instead of our custom interpolator for the spring effect. Bug: 76449024 Bug: 78089840 Change-Id: Iafac84d0c2b99ee9cf9dd5b30e2218286713b449
* Cleanup swipe detector in case of double cancelTony Wickham2018-05-041-0/+5
| | | | | | | | | | We manually dispatch cancel when returning to the previous state in onDragEnd(), but could end in a bad state if getting a second, external cancel (e.g. by pressing home). Thus, we restore the onCancelListener after manually dispatching cancel. Bug: 79258868 Change-Id: Idc4c33cede1d8af1829a4a744b9348d379bcf8f7
* Only detect swipe directions that lead to new statesTony Wickham2018-05-031-14/+44
| | | | | | | | | | This cleans up the code and ensures that the current state animation is always initialized when we get drag events. Also log when we pass through states. Bug: 78017680 Change-Id: I54ab42923ed539940ea708973ad65f5793669c11
* Fix some state issues with user-controlled animationsTony2018-05-011-15/+9
| | | | | | | | | | | | | | | | | | | | | Previously, user-controlled animations weren't properly being canceled when a non-user-controlled animation started, e.g. when hitting home. Thus, we could end in the wrong or inconsistent state because the user-controlled animation's end runnable was still used. Now we add a cleanup callback for when we reset the user-controlled animation for one that isn't user-controlled. Also fixed a couple typos. Tests (easier with animation durations extended): - Swipe up and hit home before reaching overview -> land on home - Go to overview, swipe down slightly (before threshold to go to workspace) and let go -> return to overview without flash (recents was resetting) - Swipe up, press home while swiping -> goes home, stops responding to drag - Start dismissing task and hit home before it finishes (or while dragging) -> goes home, stops responding to drag Bug: 78249220 Change-Id: If11d8999e3fadba38c987b25af67cd2304cd859b
* Call close for AbstractFloatingViews that were removed while still open.Jon Miranda2018-04-251-1/+1
| | | | | | | | | I'm not sure how/when this case occurs (perhaps during some transition/state change), but manually removing the floating view matches the symptoms in the bug. Bug: 72996404 Change-Id: I1e7c1a338fcd16c8e07b3c49fb9c9b2097eb2708
* Force finish any pending animations if the insets or orientation changeSunny Goyal2018-04-201-1/+1
| | | | | | | | | Some animation might be running from a previous orientation, which can cuase property changes to get skipped. Bug: 77848165 Bug: 77774619 Change-Id: I3e198196192746abdd72a1970ff2ef407bf4aff9
* Merge "Log dismissing or launching recent tasks" into ub-launcher3-masterTony Wickham2018-04-061-10/+10
|\