Previously we were only updating visibility in onAnimationSuccess(), which doesn't handle the canceled case.
Test: swipe up from nav bar twice in all apps, ensure all apps is invisible/non-interactable
Bug: 190315266
Change-Id: Ic59e6d4b404de4ee2d17c45d6fa59e2aee70c65f
Override onAnimationEnd(Animator), rather than (Animator, boolean)
which may not be called.
Test: Swipe right to quick switch from home, then swipe back left
(in the same gesture), ensure next quick switch isn't broken.
Bug: 185554764
Change-Id: I53e7526ed5b55fbae9aa654ace70a6ef7561e1d8
Bug: 175329686
Test: long press on apps where container opens above & below
and where container is aligned left & right
Change-Id: I09bbf57b6e19cc6f022b9a96fb48d8c4ae080813
Make it possible to set the color of workspace scrim to a different color
per state. Motivated by making Overview Scrim and All Apps scrims different
colors.
Bug: 186253733
Test: Local build and flash
Change-Id: Id7c38ce3c9173308eedfcb7592ececa7bd6bf220
- We remove the fling completely
- We set damping to 1 for x/y springs so there is no
bounciness, and updated the stiffness and bounds to tighten
up the path to the final location.
- During the animation, we translate all launcher content
down
- When the x/y springs, and rect animator all finish,
we use a spring to bounce the launcher content back up
- Added AppCloseConfig so that the entire animation can
be defined in one location, with getter methods so that
all the involved parties of the animation can access the
current value.
- The animations are all defined linearly, and then
interpolated over using a 3 point curve.
Building behind feature flag as we tune the values.
Bug: 173107751
Test: manual, visual
Change-Id: I83ad0fa2c4234cf30004240d43e191354595adc8
- Play the nav bar fade-out animation at the same time when the app
launching animation starts and make the fade-in animation ends at the
same time when app launching animation ends.
- To make the nav bar fade-in animation looks like it's attached to the
app, apply crop rect and translation that the app targets apply to the
nav target.
Bug: 181638132
Test: manual: click app icon on launcher to launch an activity and
observe the navigation bar animation.
Change-Id: If7e610eca5fccbb747a76c87335a600b018195a6
- Grid scaling has problem that scales task icon and menu, which makes it hard to control icon size and text size in the manula
- Replaced the whole concept with dedicated Task size calculation in grid layout
- Support different icon size in TaskView in grid and removed task_thumbnail_top_margin
- Removed grid progress in TaskViewSimulator as well
- Refactored how ClearAllButton scroll and translations are calcualted to align clear all properly in grid
- Make page center calculation aware of PagedView pivot and scaling
Bug: 174464863
Test: Manual on two screens
Change-Id: I47b13ef6e55c6e16c52ea04225f5bde02ed82fc2
This would simplify reusing the same code for 3-button mode
Test: Verified on device
Bug: 175137718
Change-Id: Ia757eec069efc251475baa6af38c690431325f66
- Map to progress 1 instead of dividing by 0 if expectedDuration == 0
- Map to starting progress one frame ahead based on velocity
- Change direction of velocity so it's in the same direction as the
task progress (0 is down and 1 is up).
Change-Id: I5ac3f8a0d6c616bd303ac1a902242964bb33d3c7
- Rename "pullback" to "resistance" to reduce confusion.
- Remove mDragLengthFactorStartPullback & mDragLengthFactorMaxPullback
- Add AnimatorControllerWithResistance, which has 2 controllers, one
for the normal shift to overview, then one to apply the resistance
when swiping beyond that.
- Don't hack animator interpolators/progress; insteaad, allow progress
to go > 1 (which will run the separate resistance animator).
- Don't start launcher controller separately from window controller;
instead, both are controlled by mCurrentShift in updateFinalShift().
- The resistance animation logic is shared by both the active window
and launcher (RecentsView).
Bug: 149934536
Change-Id: Ib0f9da18e10cc9ddf1a2f82ed767f237c89d3a41
This reverts commit a8c08584a7.
Reason for revert: "caused a regression with quick switch from home: if you start the gesture then swipe back to the left, it ends up launching the task anyway"
Change-Id: I8e12e2de46b6fc6a3faeb0336762da08080c61d6
With the second swipe, we never complete the swipe to Overview
NoButtonNavbarToOverviewTouchController#maybeSwipeInteractionToOverviewComplete
- mReachedOverview = true
- mDetector.isSettlingState = false
And then the second swipe starts the state transition to Hint but then
it never gets completed because:
1. The animation starts
2. Gets cancelled
3. Starts again
4. Finishes, but is not marked as success since the cancel in #2 was never
set back to false
Bug: 160759508
Change-Id: I8c3972e6209c3d5a4a0bdd9f9b7683de18105d57
Doing this at the root instead of individually for all added
animators ensures none fall through the cracks.
Fixes: shelf moving too quickly in 2 button mode
Change-Id: I0de1ba9cee3fb8f1d6161371625d97e4b2305129
AnimatorPlaybackController was using setCurrentPlayTime to control animation,
which converts progress (float) to duration (long) causing the progress to
loose accuracy.
Instead calling setCurrentFraction(float) on the target animation.
Bug: 155164803
Change-Id: I3e4c93c5a75a9ba16e80adee97229c974ffc86b1
Also applying transform params in DeviceLockedInputConsumer directly
instead of going through AppWindowAnimationHelper
Bug: 156398988
Bug: 155816922
Change-Id: I791e1a9feb07c4fb787130f8d040a4f404faf734
Animations should only be canceled (as opposed to ended) if the
caller is intending to update the state from there. In that case,
we shouldn't jump to the end value.
Bug: 155335494
Change-Id: I93a21f0e2e1923ccdfab890adcb58c49ceb98a28
Removing optional 'shouldAnimate' flag. This was false only in 3-button mode but
the code was also handling animation, leading to inconsistent expectations. Instead
always assuming animation and finishing the animation promptly.
Change-Id: Ic56476dc5ea64c9a7d7e9744f3e33cd61dfde9e8
Was able to repo the bug reliably when calling cancel() and
end() immediately after starting the StaggeredWorkspaceAnim.
Bug: 153584267
Change-Id: I954d38ad69e72a83535f4dd1ec21dba0f61a3cfb
=> setCurrentPlayTime is bounded between [0, duration] by the animation framework
Instead using interpolator so that we can go outside the bounds
=> Tune spring stiffness and dampening for overview card dismiss animations
Bug: 154061408
Change-Id: Iaa31491fff499db916b36d9779ec159b8a89a2de
Using PendingAnimation for animation builder.
This will allow us to easily add SpringAnimation to stateAnimation
Change-Id: I8d88489a5da6fc85747ef9be7c13858b441cd28a
AnimationBuilder and PendingAnimation have similar logic. This will
allow to unify the two classes
Change-Id: Id8c1d8a7020d132adbccdc6c80538ed6556cb75e
> Adding flag support for PendingAnimation which can be used
to define custom behavior for various animations
> Using SpringAnimationBuild for spring animation instead of
SpringObjectanimator
Change-Id: I41ca34b0574981bb3fc7894639a321c12e6feac1
When ENABLE_OVERVIEW_ACTIONS flag is enabled, swiping up from the nav
bar goes to overview if you hold, or the first home screen if you don't.
- Added NoButtonNavBarToOverviewTouchController, which extends
FlingAndHoldTouchController but only works if you start from the nav
bar. Otherwise it falls back to PortraitStatesTouchController to
handle normal state transition to all apps.
- Added HintState. This is where the workspace/hotseat/qsb scale down
when you swipe up from the nav bar, to hint that you're about to
either go to overview or the first home screen.
- Added getQsbScaleAndTranslation() to allow Overview and Hint states
to treat it as part of the hotseat.
- Since Overview needs to show above the QSB as it's animating, bring
Overview to the front and update OverviewScrim to handle the case
where there's no view above Overview to draw the scrim beneath.
- ENABLE_OVERVIEW_ACTIONS is always false in 2-button mode, since the
shelf is crucial to that mode.
Bug: 143361609
Change-Id: I743481bb239dc77f7024dc98ba68a43534da2637
- Add NoButtonQuickSwitchTouchController which uses
BothAxesSwipeDetector to track horizontal and vertical motion.
- Initially, we only detect swipe left to right to quick switch
(like before), but then we allow swipe up to either go to
overview (if you hold) or back home (if you don't hold).
- xDisplacement transitions non-overview components out (e.g. shelf
and workspace), and translates overview in.
- yDisplacement translates overview up and scales it down
Bug: 126596417
Change-Id: Id679ad84c08246e205c667a78ed5df00d7276258
Calling scrollToPosition on RecyclerView internally calls
requestLayout() (to cacluate where to scroll and then go there).
Therefore, we should avoid calling that whenever possible, especially
during transitions. In particular, we can optimize scrollToTop() to not
scrollToPosition() if we are already at the top.
This makes some other workarounds unnecessary, namely setting All Apps
to GONE during system gestures.
Test: Open an app, swipe up, ensure AllAppsRecyclerView doesn't get
onLayout(). If we had scrolled to an app first, we get one layout
in prepareRecentsUi(), but not during the transition.
Bug: 140308849
Change-Id: I62ee341bf5893c121cfc013cc6542559f79d2a42
We already set the all apps content visibility = GONE at the start of
the gesture to prevent relayouts, but when animating home we were
inadvertently changing it to INVISIBLE, causing a relayout and jank.
Bug: 140308849
Change-Id: I285746f8ac8f3f857282e22ebec8eebd0b98647f
Now floating headers get 2 interpolators: one for the header content
itselt, and one for the all apps content that follows. That way, they
can choose to intperolate part of their content as if it were part of
all apps instead of the header. Currently, we do this to animate
predicted icons quickly, followed by the all apps icons, predictions
text, all apps scrollbar, and all apps divider as you continue swiping.
Bug: 132455160
Change-Id: Ib3e373c291e174e1306a53854d0ad4dc29eb4b76
- Refactor some basic scrim logic to Scrim class and have
WorkspaceAndHotseatScrim and OverviewScrim extend it
- Draw OverviewScrim under recents unless predictions are disabled, in
which case draw it under hotseat (since that is in recents)
- Remove sysui scrim (behind status bar and nav bar) when overview is
peeking
Bug: 132455160
Change-Id: Ia5d6f54582a4c5a70e3b2d4a98281567edd68519