Commit Graph

2009 Commits

Author SHA1 Message Date
Tracy Zhou
f9abe7bcbd Update rect in LiveTileOverlay via copying
Probably a recent change updates the rect when reaching overview, which wasn't happening before. Regardless, we shouldn't have copied the rect by reference since the referenced copy can be changed.

Fixes: 165143463
Test: manual
Change-Id: I9315a20226f0a4b3440ce5ee6cc1f4ed1ddca487
2020-08-17 22:27:55 -07:00
Tony Wickham
532b962a03 resolve merge conflicts of 107fe60f6e to ub-launcher3-master
Change-Id: I9a1c52e66edd627fd54cc3cb423fa28a6175f8ac
2020-08-15 00:20:44 +00:00
Tony Wickham
d844fe758c Remove ENABLE_OVERVIEW_ACTIONS flag, defaulting to true
We no longer support the "peeking" model where the shelf would
peek on motion pause from an app and overview would peek on motion
pause from home. Thus, removed/inlined the following:
- FlingAndHoldTouchController (merged into its sole subclass
  NoButtonNavbarToOverviewTouchController)
- ShelfPeekAnim
- OverviewPeekState

Change-Id: I066a3ad2636fde4786089c922b896bf1e03361fd
2020-08-14 15:58:29 -07: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
4fb5f74bb4 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
2020-08-14 14:38:24 -07:00
Sunny Goyal
5fb83a47f2 Removing icon recents version
Change-Id: Ibdc88715e38590cedf8a7b5174061bb2c6ef9533
2020-08-14 10:49:19 -07:00
Tony Wickham
59d04e6ea6 Use system VelocityTracker instead of forking least squares algorithm
Change-Id: I8e03cdd0942b9037054cd1955bdb6809c89f3ea2
2020-08-13 10:41:49 -07:00
TreeHugger Robot
9529b95e06 Merge "Store mHistoricTimes as longs intead of floats" into ub-launcher3-rvc-qpr-dev am: f35053ad58
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12365858

Change-Id: I3c21d9d47a525e9c975c6acf38c99a2f1668359c
2020-08-13 02:25:50 +00: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
TreeHugger Robot
74f218530e Merge "Wrapping display properties in a wrapper class" into ub-launcher3-master 2020-08-12 23:36:27 +00:00
Sunny Goyal
fd58da6a75 Wrapping display properties in a wrapper class
This would allow us to support gestures on multiple-displays

Change-Id: I8f426bbdf04520f4189cadce2bde6aab4933c8d9
2020-08-12 13:43:56 -07:00
Sunny Goyal
d62e797d18 Disabling debug log as the associated bug is closed
Bug: 154951045
Change-Id: I2e503c6d2f0a9f694ee1f88167924114fe495c2f
2020-08-11 12:11:18 -07:00
Tony Wickham
cf5aea05b3 Update overview from home transitions am: 03a4a0cd53
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12184426

Change-Id: Iac33ad0742264a97e754a1cc4336ed3ab727944a
2020-08-10 21:29:00 +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
e6f9e0eb7e Revert "Update overview from home transitions"
This reverts commit f3bc797182.

Reason for revert: updating upstream, need to wait to cherry-pick until that's approved

Change-Id: I702286dba66fb4582ab682a5b0b8cd80ccebf346
2020-08-10 19:13:17 +00:00
Tony Wickham
f3bc797182 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-08 19:18:57 +00:00
Tony Wickham
70a556da1d Add translation component to swipe up resistance am: ce8b2b5180
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12174363

Change-Id: I18d7be49bb3bfc9f846c14a9138b5daf381e1d56
2020-08-07 20:22:52 +00: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
Jason Chang
8aaafc9186 Merge "Refactoring One-Handed feature flag and others" into ub-launcher3-master 2020-08-05 04:28:29 +00:00
Jason Chang
f66f2f66cf Refactoring One-Handed feature flag and others
Purify some conditions for reducing redundancy codes.

Test: manual
Change-Id: I2f39207424f9db3fb6b12bc08bee525f3dfab0aa
2020-08-04 19:59:42 +08:00
Raman Tenneti
ab98166c36 AOSP/Launcher3 - Update language to comply with Android's inclusive language guidance.
See https://source.android.com/setup/contribute/respectful-code for reference

BUG=161896447

Test: make and Presubmit verify.

Change-Id: I44e903046dd4cd9c7c07872fc56a8d552eb09522
2020-08-04 00:35:03 +00:00
TreeHugger Robot
cb89edcbcc Merge "Changing minimum supported Launcher version to 26" into ub-launcher3-master 2020-08-03 22:24:14 +00: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
Tony Wickham
03c38c5c66 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
2020-08-03 13:59:38 -07:00
TreeHugger Robot
3834574916 Merge "Fixing wrong velocity state when there are too few samples" into ub-launcher3-rvc-qpr-dev am: 073673e173 am: 52e00d2287
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12275360

Change-Id: I8856f0a4699ba21a1b2bf0ff278c48dad6a423cc
2020-07-31 18:49:34 +00: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
Jason Chang
c22726e067 Merge "Refactoring to use more precise statements when calculating gesture distance and others" into ub-launcher3-master 2020-07-31 02:19:17 +00:00
TreeHugger Robot
54b1d57db0 Merge "Log entire touchable region rect" into ub-launcher3-master 2020-07-31 01:17:11 +00:00
Pinyao Ting
9e13c951f2 Minimal Phone Mode (part-2) am: 553d4dfe7d am: d5d44bcda7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12193271

Change-Id: I760776ca825f728a44dde88de9f45400324f6ced
2020-07-30 23:28:14 +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
Vinit Nayak
2c80b305f4 Log entire touchable region rect
Bug: 162001398
Change-Id: Icac1d81cd6d11aa47279c81db8cc2e5ff92d6b0c
2020-07-30 15:42:30 -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
Jason Chang
b0611351e3 Refactoring to use more precise statements when calculating gesture
distance and others

1) Use more precise statements when calculating gesture distance
and refine ACTION_CANCEL motion events and others.

2) Check system property "ro.support_one_handed_mode" to enable or
disable one-handed quicksteps gesture feature.

Bug: 160315874

Test: make and install
Test: manual enable one handed mode and swipe down to trigger
Test: manual start one handed and rotate device
Change-Id: Ib27f9b6f92edda3cbff1ecb554b1a70f2e56e552
2020-07-30 23:16:09 +08:00
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07: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
Tony Wickham
7383d4e6d2 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
2020-07-29 20:05:29 +00:00
Sunny Goyal
52e2545a66 Removing arrow indicator from homescreen and
adding a separate view for various accessibility actions

Bug: 159247871
Change-Id: I14536844929e03d36a6a5f294d4f5daad8c82d15
2020-07-28 14:21:31 -07:00
Andy Wickham
a6684ba440 Merge "Adds haptics to Overview gesture in Sandbox." into ub-launcher3-rvc-qpr-dev am: 91fbf6619a am: 4341d7847b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12230464

Change-Id: Ide2387406eaaad3c281749b9d7bc90f3e403883e
2020-07-28 02:07:46 +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
Sunny Goyal
fe00c09076 Unifying handler (#1) BaseSwipeUpHandlerV2 => AbsSwipeUpHandler
Change-Id: I34647ced0e96e63cdbba35f6eb3bdc3f86810ebe
2020-07-27 15:09:22 -07:00
TreeHugger Robot
25b5872296 Merge "Fixing touches getting ignored just after swipe-up" into ub-launcher3-rvc-qpr-dev am: 8527620201 am: 7ed153fbb7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12212836

Change-Id: Ic4d6a37008a7e214357c995e3d37c4a4a9da2694
2020-07-27 18:04:51 +00:00
thiruram
90573f0515 Logs system navigation details part of launcher snapshot logging.
Bug: 157997545
Change-Id: I18e908dc62bb790c3a77e1aacd0236a7d84e8ce5
2020-07-27 09:51:52 -07: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
Winson Chung
18b76be7f2 Merge changes from topic "ub-one-handed-rebase" into ub-launcher3-master
* changes:
  Guard swipe to notification gesture with system settings preference
  Update state and touch region after one handed overlay changed
  Hook one-handed gesture to expand notification panel by default
  Enable one-handed mode gestural in QuickStep
2020-07-23 02:37:54 +00:00
thiruram
a4661192ff Limit launcher snapshot logging once per day.
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)
2020-07-22 15:51:03 -07:00