- 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
Merged-In: Ib0f9da18e10cc9ddf1a2f82ed767f237c89d3a41
Instead of calculating an overall distance for tasks to translate
based on RecentsView width, calculate the distance for the tasks
to the left and right of the midpoint based on how far the first
adjacent tasks in those directions are from being offscreen.
Changes made to make "distance to offscreen" calculations possible:
- Update TaskView curve scale to reach final scale as soon as it is
completely offscreen. Before, it would reach its final scale just
shy of that point (calculations were off).
- As we update RecentsView scale, calculate how much the new scale
will push out tasks that are just offscreen.
- With both above, we can calculate the scale and position of a
TaskView such that it is just offscreen, and interpolate
between its current position and that position.
Tests:
- Task comes in immediately when quick switching from home, and
doesn't shift as you swipe directly upwards.
- When swiping far up from an app, tasks come in from all the way
offscreen, and cover distance appropriately (e.g. if you're
scrolled a bit to the right when you pause, the left adjacent
app will move faster to cover the farther distance).
- Task modalness: entering Select mode now animates adjacent tasks
at the same rate as the scaling up, because they move only the
distance needed to get offscreen (before they moved way too far
and thus seemed to be much faster than the rest of the animation).
Bug: 149934536
Change-Id: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
Merged-In: Ie3fffe0e5c304cb16e7637f058f5ce72cee40aeb
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
Moving the input proxy logic outside the recents controller, so that it
is not lied to the controller lifecycle.
> Fixing input consumer not getting registered if recentsController
was not received until ACTION_UP
> Fixing input events being ignored after finishing recentsAnimation,
but before handler is invalidated
Bug: 161750900
Change-Id: Ib06617caef77f18a71c5a231e781291c3a4ee57e
- Launcher already dedupes if there are no theme changes
Bug: 148988542
Test: adb shell cmd uimode car yes/no, adb shell cmd uimode night yes/no
Change-Id: Ia83f02d18a0433c8be59d1f488e58b38476ba5ff
Merged-In: Ia83f02d18a0433c8be59d1f488e58b38476ba5ff
Using a negative margin to move the icon view to stick out above
the task prevents that part sticking out from receiving touches.
They go directly through to RecentsView, which interprets it as a
touch to home.
Now we use a touch delegate that recents view passes touches to
before processing it directly.
Note we can't override should steal touches from children in
LauncherRecentsView because the icon view isn't actually seen
as a child of RecentsView if it's outside of the task view area.
Fixes: 159820339
Test: Touching anywhere on the icon works.
Scrolled to previous/next tasks and in different
rotations and verified tap registers correctly.
Change-Id: I4559c34b20079e06aac401e2c93ac36a74b653ea
This change will make sure launcher snapshot is logged only once in 24hrs interval using sharedpreference.
Bug: 161375303
Change-Id: Iab6b25d931b2e91ae5647e266bd68ead86c99bc6
Merged-In: Iab6b25d931b2e91ae5647e266bd68ead86c99bc6
(cherry picked from commit efa41c1c52)
When user swipes up to home, Launcher will receive a onNewIntent
callwith a bundle-extra gesture_nav_contract_v1. It will contain
the componentName & UserHandle of the closing app & a callback.
Launcher can use the callback to return the final position where
the app should animate to and an optional surface to be used for
crossFade animation. The surface cleanup can be handled in
onEnterAnimationComplete.
Change-Id: I76fdd810fdcb80b71f7d7588ccac8976d9dfe278
The rotation of WindowConfiguration in Configuration is non-public
field. There is no guarantee that the information will be updated.
E.g. a 180 degree rotation change won't make difference to the
public configurations, so the Resources will keep the old one.
The display rotation of activity is accurate to use for its content
because even the activity is transformed to different rotation than
the physical display, there is FixedRotationAdjustments to adjust
the information which will be consistent as how the activity is
laid out.
Bug: 159877752
Test: 1. Enable auto rotation.
2. Launch some portrait activities.
3. Put device in reverse portrait (upside down).
4. Launch a landscape activity.
5. Swipe to another activity with full-sensor orientation.
6. Return to home and enter recents to check the task views
of step 2 don't show upside down.
Change-Id: I5e16e71d43b8892a394c06de9e76fb3d4ad55919
restoreBackup uses mBackupRestored to prevent multiple restorations happening at once. This change is required to reset the value of mBackupRestored if a new backup is created.
Bug: 160033826
Test: Manual
Change-Id: I33836b26cf3876955cc14dcc8ec06202f3fe7fac
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
Test: swipe up from an app in landscape, seascape, and portrait,
and verify the window tracks with the finger 1:1 until pullback
Bug: 149934536
Change-Id: Ia469877e7152c8135e0b9153f69c191ba86cbd14
(cherry picked from commit f0a1b2ccd8)
* Velocity should match the direction of the spring values.
(Swipe direction is upwards, but icons move downwards on screen).
* Remove additional conversion to pxPerS since getDimension already does that.
Bug: 160003774
Change-Id: I12912edb2354c4a30c538da6ca3789c46d82b94d
(cherry picked from commit 54003963d8)
There's currently a bug prevents Launcher release drag lock for two step
widgets. Supposedly, onDeferredResume should release the drag lock; However,
in 3-button navigation mode, the transition from Overview -> Normal is
triggered in Launcher#onNewIntent, which happens after onDeferredResume.
This issue is not reproducible with gesture navigation because its
transition from Overview -> Normal is handled in NavBarToHomeTouchController
Test: manual verified with following steps
1. Enable 3-button navigation
2. Long press in WorkSpace -> Widgets
3. Drag Settings Widget to WorkSpace
4. When the config activity is shown, press "recents" button to see Overview
5. press "home" button to go back to workspace
6. repeat 2 and 3, verify the widget can be dragged
Bug: 149659788
Change-Id: I396ffa8a7db44bf3872a10de4208340a99a7efe8
(cherry picked from commit 3bf889a02f)
There was a race condition between when recent
tasks get loaded for overview and when the
RecentsOrientationState gets updated based on
which orientation was touched. Now notify
tasks view every time orientation state
updates.
Fixes: 160912655
Test: Kill launcher while landscape app
is open then swipe up to recents.
App in correct location.
Change-Id: If2b239f748c000257bd91b14a23d68ba026e3a48