Commit Graph

4604 Commits

Author SHA1 Message Date
Tony Wickham
5662a653da Separate TaskView translationX into dismiss + offset translations
- Previously, these both setTranslationX() directly, meaning one
  could clobber the other. Now they are set independently and
  aggregated to setTranslationX().
- For fake landscape, we actually are setting translationY, so
  had to create both translationX and translationY properties, and
  set the appropriate one via the current orientation handler's
  "primary" dimension.

Fixes: 176766821
Change-Id: I204f039331dd43bbbf87bf6a2249238daf4d9877
2021-01-19 23:00:45 +00:00
Winson Chung
a18b9f3e42 Merge changes from topic "revert_ui_mode_changes" into rvc-qpr-dev
* changes:
  DO NOT MERGE Revert "Handle uiMode changes"
  DO NOT MERGE Revert "Defer recreation until resumed"
2020-11-10 22:17:52 +00:00
Hyunyoung Song
64340cca97 [DO NOT MERGE] Add WW log for noti shade swipe down from home.
Bug: 171973663
Change-Id: I1e8ff20c62d4f91a05cb1cfc0337e351f2bc8885
(cherry picked from commit a87f99a35a)
2020-11-05 08:55:40 +00:00
Winson Chung
4b4341d3a7 DO NOT MERGE Revert "Handle uiMode changes"
Bug: 171707437
Test: Repro steps on bug

This reverts commit 0ad7b172e6.

Change-Id: If30cbb6c155e879dc8307a0a4a06dfb548b389a1
2020-10-28 19:18:03 -07:00
Tony Wickham
d007cd5d55 End the attaching animation early when we settle on the end target
The attaching animation can take longer than the transition to recents
when you let go, and the ADJACENT_PAGE_OFFSET calculation is different
when there's a running task vs not. So after the transition to recents
ended, the calculation of the still playing attaching animation would
change, causing the jump you see in the bug. Now we make sure to end
the attaching animation if it's still running when we settle on an
end target to avoid this issue.

Fixes: 168563692
Change-Id: I3f37aecf9c93f2ec63dbdce561e7f5ba11be89cc
Merged-In: I3f37aecf9c93f2ec63dbdce561e7f5ba11be89cc
(cherry picked from commit 1cc12ebc12)
(cherry picked from commit fd54a8e84a)
2020-10-23 22:41:55 +00:00
Hyunyoung Song
743fe26951 [DO NOT MERGE] Add component name to launcher home and overview gestures
Bug: 168805198

Change-Id: Idcc7d00b0f23c2a0f9be6f0ab2600278e18cc1a3
(cherry picked from commit e6477328aa)
2020-10-01 16:56:35 +00:00
TreeHugger Robot
fd2f276d4e Merge "[DO NOT MERGE] Make overview to home translate faster" into rvc-qpr-dev 2020-09-24 22:45:02 +00:00
Tony Wickham
0a22d107f6 [DO NOT MERGE] Make overview to home translate faster
Fixes: 169052350
Change-Id: Ia6f21f479498927a5561819fcc256b698acbd095
2020-09-24 19:14:56 +00:00
Tony Wickham
a5dae88b71 [DO NOT MERGE] Remove CurveProperties#pageParentScale
Test: Set TaskView#EDGE_SCALE_DOWN_FACTOR = 0.2f, then swipe
down on the centermost TaskView; ensure it fills the screen.
Alternatively, touch and hold the nav bar and ensure there is
no jump in scale on the app window.

Fixes: 169259407
Change-Id: Ib3cfba6ebafbcb90de9c6b1ab79f53605d995321
(cherry picked from commit 82ff64530e)
2020-09-24 17:31:31 +00:00
Sunny Goyal
41874d1e02 [DO NOT MERGE] Snapshot strings from ub-branch to platform
Bug: 159176821
Change-Id: Ia079de403bed5ee7501a2d70f40989dcfafbddc7
2020-09-23 14:51:35 -07:00
Winson Chung
f5e8ecda30 DO NOT MERGE Only check activity rotation allowed when considering menu layout
- The canRecentsActivityRotate() also checks whether system rotation
  is enabled which prevents us from using the right layout orientation
  when home rotation is enabled while system rotation is disabled.

Bug: 168278832
Test: Tested menu visibility in combination of
      Auto rotate setting x Home rotation setting X Device orientation
Change-Id: If74a38b1ec51abd2ea7f3ba3de23f0b2c4cab0ab
Merged-In: If74a38b1ec51abd2ea7f3ba3de23f0b2c4cab0ab
(cherry picked from commit 9cd3740fe7)
2020-09-22 19:16:30 +00:00
vadimt
01a51f5bb9 Merging from ub-launcher3-rvc-qpr-dev @ build 6809704
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-rvc-qpr-dev_rvc-qpr-dev_6809704.html

Change-Id: I870f8ec233dfae0c9c857ebb050217879f83ba65
Merged-In: Ib9d52ba333f2982d2420cab42a0935e8e8a303b3
2020-09-03 02:59:35 +00:00
TreeHugger Robot
39c79929d1 Merge "Make modal based UI changes in TaskView only if modalness changes." into ub-launcher3-rvc-qpr-dev 2020-08-28 23:08:11 +00:00
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
7c39afeccc Merge "Scale down chip proportional to TaskView becoming fullscreen." into ub-launcher3-rvc-qpr-dev 2020-08-28 22:10:57 +00:00
TreeHugger Robot
7d7b471a6c Merge "Implementing TouchDelegate to make full chip clickable." into ub-launcher3-rvc-qpr-dev 2020-08-28 17:53:54 +00:00
Sreyas
8a622edb78 Scale down chip proportional to TaskView becoming fullscreen.
Tested: Manual
Change-Id: I09c80b28cb01fb4873efffa8d4856b63af32493f
2020-08-28 10:20:05 -07:00
Sreyas
fee2b25b9c Implementing TouchDelegate to make full chip clickable.
Bug: 166376182
Tested: Manual
Change-Id: I36b2559908fbf7ab6a863fb6e550a88b5374aefa
2020-08-28 10:10:30 -07:00
TreeHugger Robot
01a5b52b42 Merge "Fix a couple issues with overview to home transition" into ub-launcher3-rvc-qpr-dev 2020-08-26 21:54:08 +00:00
Tony Wickham
5c460a4663 Fix a couple issues with overview to home transition
- 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
2020-08-24 23:29:14 +00:00
Tony Wickham
0486a03832 Merging from ub-launcher3-rvc-qpr-dev @ build 6777894
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-rvc-qpr-dev_rvc-qpr-dev_6777894.html

Change-Id: I4a4a422b2f70c2107c21161c662a4aac3fee7903
Merged-In: I0bb722c8f29e91cb382337f8b11bcf43d711949b
2020-08-21 19:07:27 +00: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
fa9675a32e Merging from ub-launcher3-rvc-qpr-dev @ build 6770831
Bug:150504032
Test: manual, presubmit on the source branch
x20/teams/android-launcher/merge/ub-launcher3-rvc-qpr-dev_rvc-qpr-dev_6770831.html

Change-Id: Ic07dd8bd495cd0e013a00a29d9d9f11e246dc568
Merged-In: I5e9c73a7ac3033fe82006c4bd72824f56b8988f8
2020-08-18 04:59:10 +00: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
Tony Wickham
94dbcefe2a Store mHistoricTimes as longs intead of floats am: 31ef24c934
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12375534

Change-Id: Ie82539f445850e62edc424fe088c41cc28890d6b
2020-08-14 10:46:38 +00:00
Tony Wickham
31ef24c934 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
(cherry picked from commit a145670969)
2020-08-14 06:24:05 +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