- In fake portrait, fade out instead of translating offscreen, as
the orientation doesn't map to where RecentsView actually lives
- From OverviewModalTaskState, start from > 1 scale, and use
OverviewToHomeAnim (to ensure RecentsView doesn't fade out etc)
- To keep parameter list sane, added RecentsParams to
AnimatorControllerWithResistance which has the new startScale
(set to current scale for modal state) and renames the old
RecentsParams to RecentsResistanceParams. Sorry if that's
confusing.
Bug: 144170434
Change-Id: Id36ebde440b398159cef50d95822627fca761527
Merged-In: I437f0d18cad4c94feea25954aed3390acedcaed5
Animating this new property allows us to adjust the scrim without
competing with other state animations that could be setting the
scrim progress. Also reset scrimMultipler = 1 for state transitions.
Test: Swipe from home to overview, then during that transition swipe
from overview to home; when the former transition ends while the
second is still in progress, ensure scrim value doesn't jump
Bug: 144170434
Change-Id: I44b57ced1c6902e558fe1818bcbf11ceb4ff2f6f
Merged-In: I44b57ced1c6902e558fe1818bcbf11ceb4ff2f6f
Introduces a separate database for minimal device mode.
When minimal device mode is enabled/disabled:
1. WellbeingModel receives onChange event from ContentObserver
2. WellbeingModel called DWB's ContentProvider for latest state in
minimal device mode
3. Based on the state, WellbeingModel calls LauncherProvider to put
launcher into normal/minimal mode.
4. When going from normal -> minimal, Launcher switches to a different
database, namely minimal.db, then proceed to database initialization.
5. If the database hasn't been initialized yet, Launcher will call
ContentResolver#openInputStream with following uri:
content://com.google.android.apps.wellbeing.api/launcher_layout
to get the default layout xml.
6. The default layout is then saved in database, and the database is
considered initialized and doesn't need to go through step 5 again in
the future.
7. In case of minimal -> normal, Launcher switches back to its original
database (e.g. launcher.db if the grid size is 5x5), then reload launcher.
Bug: 161462256
Change-Id: I6bafa66440da23281f63454b698ea56b15960022
This way we mark the the current state as NORMAL at the start of
the animation, and cancel it as part of other state transitions.
This allows us to interact with launcher (e.g. to go to all apps
or pull down the notification shade) during the animation.
Also use OverviewToHomeAnim from RecentsView#startHome() to
ensure the animation is consistent, e.g. doesn't fade out
RecentsView, scrolls to page 1, etc.
Bug: 144170434
Change-Id: I5348565b9e705d8ffba39818dde9efe82b16bb7a
Merged-In: I5348565b9e705d8ffba39818dde9efe82b16bb7a
The loss of precision was causing us to miscalculate the age of
events, and thus not detecting any pause due to denominator = 0.
Test: have a device that hasn't been rebooted for a certain
amount of time such that SystemClock#uptimeMillis can't be
accurately converted to a float, then try to swipe up and hold
Fixes: 160568387
Change-Id: Idef112187f34a18feea7e6a0b77258626f9d0ed4
(cherry picked from commit a145670969)
The loss of precision was causing us to miscalculate the age of
events, and thus not detecting any pause due to denominator = 0.
Test: have a device that hasn't been rebooted for a certain
amount of time such that SystemClock#uptimeMillis can't be
accurately converted to a float, then try to swipe up and hold
Fixes: 160568387
Change-Id: Idef112187f34a18feea7e6a0b77258626f9d0ed4
For both NoButtonNavbarToOverviewTouchController and
NavBarToHomeTouchController:
- Have consistent resistance applied such that RecentsView scales
down and translates up slightly (but not as much as from an app)
- Have consistent animation to home if you fling to that state
rather than stay in overview. This is handled by a new class,
OverviewToHomeAnim, which consolidates logic from NBTHTC and
overrides some interpolators such that RecentsView doesn't fade
out or translate downwards during the animation (it just slides
off the screen while the home animation plays).
Also make overview actions not clickable when alpha == 0, so that
you can tap the hotseat/qsb during the transition from home to
overview.
Bug: 144170434
Change-Id: Ic291f285ff2f63c477633c48d4fadb23cf70c28a
Now recents view follows your finger all the way to the top of the
screen. Specifically, your finger tracks the bottom of the window
until resistance starts (when RecentsView is at 75% scale), then
we add translation to compensate for the slower rate of scaling
down, such that your finger slips to the top of the window by the
time it reaches the top of the screen.
Also reset this translation back to 0 in the state handlers.
Bug: 149934536
Fixes: 158701272
Change-Id: Iaee58da758d422f0173c29d002f5c451ce0c1809
- 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
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
(cherry picked from commit ff4b142789)
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
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
> Adding a listener in StartsLogManager for listening to events.
This allows events to be directored to the predictor only if
it is already running, instead of creating it.
> Unifying the event format to be same as hotseat predictor
Bug: 160748731
Change-Id: Ib00e6249ff642c030f00bcad5b748255e704d16a
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)