Commit Graph

3988 Commits

Author SHA1 Message Date
Sreyas
3aca92104f Make modal based UI changes in TaskView only if modalness changes.
Fixes issue with jittery displaying of suggestion chip, when entering overview.
Tested:Manual

Change-Id: Id37fcc67840402f1f66d7646cd562c282a19e312
2020-08-28 15:13:25 -07:00
TreeHugger Robot
ba9717199f Merge "Allow swipe up to go home from overivew during task dismiss animation" into ub-launcher3-rvc-qpr-dev 2020-08-20 02:59:58 +00:00
TreeHugger Robot
93f595fd5a Merge "Set new scrimMultiplier instead of scrimProgress for overview -> home" into ub-launcher3-rvc-qpr-dev 2020-08-20 02:59:26 +00:00
Tony Wickham
ff20eae383 Allow swipe up to go home from overivew during task dismiss animation
Test: go to overview, dismiss a task, swipe up to go home during the
transition (easier to try with animation duraation scaled up)

Bug: 144170434
Change-Id: I28b846b43260179aeac877351a7069743f66f3ea
Merged-In: I28b846b43260179aeac877351a7069743f66f3ea
2020-08-20 02:50:36 +00:00
Tony Wickham
375c602fc0 Set new scrimMultiplier instead of scrimProgress for overview -> home
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
2020-08-20 02:49:30 +00:00
Pinyao Ting
96186aff87 Minimal Phone Mode (part-3)
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
2020-08-19 14:58:20 -07:00
Tony Wickham
107fe60f6e Ensure we clearState() when going to Overview from home
We need to do this before potentially starting another
interaction during the animation, or we could end up in
an inconsistent state.

Fixes: 160759508
Change-Id: Ia28dceddcc258679fc0b968f5a83fae5ef3f5acb
2020-08-14 22:49:18 +00:00
TreeHugger Robot
6c1a88f172 Merge "Track OverviewToHomeAnim with StateManager" into ub-launcher3-rvc-qpr-dev 2020-08-14 22:45:17 +00:00
Tony Wickham
9dfcc316c1 Track OverviewToHomeAnim with StateManager
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
2020-08-14 22:30:33 +00:00
TreeHugger Robot
20983ae1f8 Merge "[Overview Actions] Reset the modal task view when rotate from select mode." into ub-launcher3-rvc-qpr-dev 2020-08-13 18:42:46 +00:00
TreeHugger Robot
f35053ad58 Merge "Store mHistoricTimes as longs intead of floats" into ub-launcher3-rvc-qpr-dev 2020-08-13 02:10:20 +00:00
TreeHugger Robot
30fe240f99 Merge "TaskOverlayFactory - remove static factory." into ub-launcher3-rvc-qpr-dev 2020-08-13 00:47:34 +00:00
Becky Qiu
ba6fec3eae [Overview Actions] Reset the modal task view when rotate from select mode.
Test: local
Bug: 161901771
Change-Id: I103e59ad68874db7fcb39556764d315983ac047c
2020-08-12 17:17:59 -07:00
Tony Wickham
a145670969 Store mHistoricTimes as longs intead of floats
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
2020-08-12 17:02:53 -07:00
Zak Cohen
cbe1fc063d Merge "Overscroll plugin - give the plugin its own factory." into ub-launcher3-rvc-qpr-dev 2020-08-12 23:58:38 +00:00
Zak Cohen
cf82754384 TaskOverlayFactory - remove static factory.
Make the overlay factory a member of the recents view.
Before the factory was static. The factory has references to activity
objects so was causing leaks.

Bug: 162012217
Tested: local, factory still works
Change-Id: I2283134f3008b630ba2056f07e65ac042957cdbd
2020-08-12 16:32:45 -07:00
Becky Qiu
9367f98348 [Overview Actions] Set launcher state to Overview when rotate in recents.
Test: local
Bug: 160718310

Change-Id: I73f498151d7cc6a9db9d352549124c9d550ae6f2
Merged-In: I73f498151d7cc6a9db9d352549124c9d550ae6f2
2020-08-12 00:54:20 +00:00
Zak Cohen
fac8741522 Overscroll plugin - give the plugin its own factory.
Separate out the overscroll plugin from the task overlay.
These two classes aren't really related.

Bug: 162012217
Tested: checked plugin still works
Change-Id: Id89eff1ad2ae9766efaaecd8cfc66d6521b9ca8c
2020-08-11 16:42:23 -07:00
Tony Wickham
e14b55c2a9 Merge "Don't reapply window transform if we are already running a window anim" into ub-launcher3-rvc-qpr-dev 2020-08-11 00:19:28 +00:00
TreeHugger Robot
b460ff1ef1 Merge "Fix TaskViewTouchController success progress to match haptic" into ub-launcher3-rvc-qpr-dev 2020-08-10 22:46:03 +00:00
Tony Wickham
06513f11c2 Don't reapply window transform if we are already running a window anim
Bug: 149934536
Change-Id: I3fa7f0b2581ca83923a42f37f52850b02c22e995
Merged-In: I3fa7f0b2581ca83923a42f37f52850b02c22e995
2020-08-10 22:20:36 +00:00
Tony Wickham
03a4a0cd53 Update overview from home transitions
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
2020-08-10 13:15:23 -07:00
Tony Wickham
999e08f6ff Merge "Add swipe up resistance to quick switch from home" into ub-launcher3-rvc-qpr-dev 2020-08-08 02:18:46 +00:00
TreeHugger Robot
2ace6a25d2 Merge "Fixing cutouts insets not clipped properly during swipeup for rotated activities" into ub-launcher3-rvc-qpr-dev 2020-08-08 00:00:28 +00:00
TreeHugger Robot
3a22956f0a Merge "Remove overscroll on running task when it's not attached to RecentsView" into ub-launcher3-rvc-qpr-dev 2020-08-07 23:44:37 +00:00
Tony Wickham
d6a1063f25 Add swipe up resistance to quick switch from home
Bug: 149934536
Change-Id: I1b355a16d972f94d541231449ef323a41861a3e6
2020-08-07 12:33:06 -07:00
Tony Wickham
ce8b2b5180 Add translation component to swipe up resistance
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
2020-08-07 12:32:50 -07:00
Tony Wickham
3b9d5843c9 Fix adjacent page offset in landscape orientation
Before, the adjacent tasks were coming in from the top and bottom
of the screen rather than the sides.

Bug: 149934536
Change-Id: Id6e57dcbc1967d70869df06068d25717de116934
2020-08-06 15:04:51 -07:00
Sunny Goyal
d00340f7a2 Fixing cutouts insets not clipped properly during swipeup
for rotated activities

Bug: 161939759
Change-Id: Ia55f938fdc51e2813c205d7d13d5f1bf852c9bb2
2020-08-06 14:29:15 -07:00
Tony Wickham
b8b3e957a6 Fix TaskViewTouchController success progress to match haptic
We use the interpolated progress of the animation contoller target
to determine success, but only the child animation had the
interpolator set. Updating the parent to use the same interpolator
ensures getInterpolatedProgress() returns the same one used to
play the haptic.

Fixes: 161536946
Change-Id: Ibc2aef67f53efa01f2b185cf03140bad4bb5c421
2020-08-05 18:43:53 -07:00
Tony Wickham
3af714f052 Remove overscroll on running task when it's not attached to RecentsView
This allows the running task to follow the finger freely until motion
pause is detected (or when trying to quick switch in a direciton that
has no tasks, as RecentsView is still attached until you swipe up).

Bug: 149934536
Change-Id: If68166e962af9f28c56017838f720e15ddb96560
2020-08-05 13:37:48 -07:00
TreeHugger Robot
ffc06198ff Merge "Rewrite long swipe resistance ("pullback") logic" into ub-launcher3-rvc-qpr-dev 2020-08-03 22:11:30 +00:00
Tony Wickham
354a436f4e Rewrite long swipe resistance ("pullback") logic
- 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
2020-08-03 21:01:46 +00:00
TreeHugger Robot
bf84725855 Merge "Creating UI tests for overview action buttons." into ub-launcher3-rvc-qpr-dev 2020-07-31 21:03:54 +00:00
Sreyas
bf103f16b1 Creating UI tests for overview action buttons.
Change-Id: Ie6298064a068dc978ca33fb64e1856c3ba2a8cb1
2020-07-31 13:20:08 -07:00
TreeHugger Robot
073673e173 Merge "Fixing wrong velocity state when there are too few samples" into ub-launcher3-rvc-qpr-dev 2020-07-31 18:12:40 +00:00
Sunny Goyal
48afb6b3b9 Fixing wrong velocity state when there are too few samples
Bug: 160568387
Change-Id: I32b3b7ee1bff5595941fc0c0b37c9f5a28d1a1fa
2020-07-30 15:44:05 -07:00
Pinyao Ting
553d4dfe7d Minimal Phone Mode (part-2)
Integrate with ContentProvider from Digital Wellbeing

Change-Id: Ie1fbb706e767ac5d760d686af88a9a0adf162418
2020-07-30 22:07:20 +00:00
TreeHugger Robot
d354443535 Merge "Fix adjacent task offset distance" into ub-launcher3-rvc-qpr-dev 2020-07-29 22:26:31 +00:00
Tony Wickham
16eb9226c5 Fix adjacent task offset distance
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
2020-07-29 22:17:33 +00:00
TreeHugger Robot
a2f9ea5233 Merge "Revert "Fix bug where double swipe gets us stuck in Hint state while in Overview."" into ub-launcher3-rvc-qpr-dev 2020-07-29 19:55:36 +00:00
Jonathan Miranda
f496ea4634 Revert "Fix bug where double swipe gets us stuck in Hint state while in Overview."
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
2020-07-29 19:03:29 +00:00
Andy Wickham
91fbf6619a Merge "Adds haptics to Overview gesture in Sandbox." into ub-launcher3-rvc-qpr-dev 2020-07-28 01:43:56 +00:00
thiruram
b6d0607d8b Logs system navigation details part of launcher snapshot logging.
Bug: 157997545
Change-Id: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
Merged-In: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
2020-07-27 16:32:21 -07:00
TreeHugger Robot
8527620201 Merge "Fixing touches getting ignored just after swipe-up" into ub-launcher3-rvc-qpr-dev 2020-07-27 17:36:41 +00:00
Andy Wickham
17f379bf4b Adds haptics to Overview gesture in Sandbox.
Change-Id: I4b8ec88bfc051de287b1b8ac27c4b5ab9ac90bbf
2020-07-24 16:49:15 -07:00
Sunny Goyal
ff4b142789 Fixing touches getting ignored just after swipe-up
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
2020-07-24 16:48:56 -07:00
TreeHugger Robot
6039c70261 Merge "Fixing oav text overlap." into ub-launcher3-rvc-qpr-dev 2020-07-23 22:26:16 +00:00
TreeHugger Robot
6e1861104c Merge "Handle uiMode changes" into ub-launcher3-rvc-qpr-dev 2020-07-23 21:17:35 +00:00
Winson Chung
0ad7b172e6 Handle uiMode changes
- 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
2020-07-23 21:05:31 +00:00