Commit Graph

348 Commits

Author SHA1 Message Date
Brian Isganitis
fdd044e16e Expose IS_RUNNING_IN_TEST_HARNESS as static method.
This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
2023-03-03 00:17:33 +00:00
Alex Chau
7e1144ee99 Merge "Fix IllegalStateException caused by trying to snap to destination before initalizing page scrolls." into tm-qpr-dev 2023-01-20 15:07:10 +00:00
Schneider Victor-tulias
50f66511d9 Fix IllegalStateException caused by trying to snap to destination before initalizing page scrolls.
Bug: 262256539
Test: swiped home several times
Change-Id: I1d4b515f917e89c2ee0112a408499734222c6852
2023-01-04 18:27:27 +00:00
Schneider Victor-tulias
7bb558a57e Add check for loading ever applied in check for page scrolls initialized
When "Don't keep activities" is enabled in developer settings, the RecentsView gets re-initialized every home gesture. The home animation can often finish before the load plan ever gets applied, so the page scrolls can be used before the RecentsView has had a chance to add all its TaskViews and recalculate its page scroll.

Fixes: 249020573
Test: launched an app and went home
Change-Id: I83ca9de60b50693f7a22b08534ec36973cd6a0fc
2022-12-16 03:12:58 -08:00
Alex Chau
0733ebd3c1 Run setCurrentPage in applyLoadPlan after scroll initialized
- Also combined the 2 setCurrentPage call in applyLoadPlan into 1
- Otherwise setCurrentTask may set to page 1 unexpectedly due to page 0's scroll being invalid and out of range

Bug: 246283207
Bug: 238461210
Test: Split screen with 2 apps, click back, go to overview again, should snap to focsued task
Change-Id: I3b57655c810668fe244659437fbd4a745ca02d21
2022-10-11 12:36:35 +01:00
Pat Manning
24b9554086 Add logging to help debug flake when swiping home to overview.
Bug: 238461210
Bug: 246283207
Test: TaplTestsQuickstep#testSwitchToOverview
Change-Id: I8ee9af4f4a331c43761ba3738e12acb376ababc2
(cherry picked from commit 1edba8b0a6)
Merged-In: I8ee9af4f4a331c43761ba3738e12acb376ababc2
2022-10-06 15:37:47 +00:00
Schneider Victor-tulias
a602a0a895 Add error detection for aborting the recents scrolling during transition to home
Bug: 227514916
Test: swiped to overview, to home and quick switch and checked the logs
Change-Id: Ie02d3933e2fb05eedd9c264a381329bc04feac2d
2022-09-07 14:16:08 -07:00
Tony Wickham
bed0d636fe Proper fix for gesture nav flicker using runOnPageScrollsInitialized()
I root caused the two areas causing the flicker:
A. If page scrolls aren't initialized when we get onActivityInit(), the first scroll even after linkRecentsViewScroll() will jump based on min scroll (due to Clear all button). Fix is to defer linking until page scrolls are initialized.
B. If page scrolls aren't initialized when the gesture starts, RecentsView can jump to the min scroll when calling showCurrentTask(), since that calls setCurrentPage(getRunningTaskIndex()) which might be out of bounds. Fix is to defer that setCurrentPage() until page scrolls are initialized.

Test: open a random app that hasn't been opened in a while, touch down
on nav handle and see if RecentsView scrolls partially or fully
offscreen; repeat 20 times to be sure
Fixes: 233112195

Change-Id: I000960775f8735920d97c87942065a430c9dce0c
2022-06-15 19:08:32 +00:00
Tony Wickham
3945f028de Revert line that could wrongly initialize RecentsView scroll
Test: open a random app that hasn't been opened in a while, touch down
on nav handle and see if RecentsView scrolls partially or fully
offscreen; repeat 20 times to be sure
Bug: 233112195
Fixes: 235369468

Change-Id: Ie8b3dbea7c4826af037edf22360946105ab22134
2022-06-14 19:17:55 +00:00
Winson Chung
359cb5d1b6 Ensure page scrolls are initialized even for 0 children.
Bug: 233713180
Test: Walk through CtsVerifier Lock Task UI flow as described in the bug
Change-Id: I49cb942a37a202b3e1b7ee00479d68402fcaf8b0
2022-05-26 23:38:48 +00:00
Andras Kloczl
c2bd15fd2a Fix slow page animations on large devices
- Change non-fling page snap animation duration
- Change fling gesture related minVelocity

Test: Scroll between home pages, allapps, folder pages
Bug: 229073876
Change-Id: Ib39187ec9c832e65dd0b71f8f4a00e1b636423a4
Merge "Hide web settings, if web suggestions is disabled" into tm-dev

Change-Id: Ib39187ec9c832e65dd0b71f8f4a00e1b636423a4
2022-05-12 12:56:41 +01:00
Schneider Victor-tulias
bb44c03b1c Fix janky overview animation.
Switching to overview shortly after switching to 3-button mode caused a janky animation if the PagedView wasn't properly initialized yet. Moved the animation to a callback.

Fixes: 203632659
Fixes: 223719200
Test: manual
Change-Id: I8a345036c6b7322ae3fa50a23bcb7522f57c8a90
2022-05-03 10:38:23 -07:00
TreeHugger Robot
37fa1392ec Merge "Reset touch state when removing all tasks in RecentsView.applyLoadPlan" into tm-dev 2022-04-22 17:33:06 +00:00
Andras Kloczl
07111f25f4 Change page snapping logic for large screen devices
Use 15% of the screen width instead of 40% of the page
width currently used for phones.

Test: try page snapping on Launcher home
Bug: 213305066
Change-Id: I6a525100bf942c5089f580a27250c425ca95cf00
2022-04-12 20:23:23 +01:00
Alex Chau
9d8eeabfec Reset touch state when removing all tasks in RecentsView.applyLoadPlan
Fix: 223245248
Test: com.android.quickstep.FallbackRecentsTest#goToOverviewFromHome
Change-Id: I1cc8952e077b9cc79a93d909b80e215e61e8deab
2022-04-05 17:13:56 +01:00
Alex Chau
2e48760e97 Update overview grid icon sizes and paddings
- Introduced additional page spacign for clear all button to match mocks

Fix: 222664142
Test: Quick switch to last task and immediately enter overview
Test: Dismiss last task in overview grid
Change-Id: I4d2f93d843c50b10051f3fb17027cd06e86707e1
2022-03-17 13:44:21 +00:00
Alex Chau
9ead9ca226 Fix switch access for overview grid
- Removed overscroll checking in switch access, as overscroll isn't supported via snapToPage
- Don't show forward/backward action if no further scroll is possible
- When scrolling right in overveiw grid, snap to the next non-fully visible task
- When scrolling left in overview grid, snap to a position that next non-fully visible task is on the left of the screen

Fix: 204162346
Test: Use switch action in Workspace/Recents with and w/o RTL
Change-Id: I0d4f201edf2da543703e88420e6f3255fb2ba16f
2021-11-26 17:51:32 +00:00
Alex Chau
6499e83c57 Consider launching task's position on screen in pivot calculation
- Instead of using RecentsViewScroll, put task's position offset versus current scroll as TaskRect calculation, so it's considered when calculating for putting task to full screen
- Revert back RecentsViewScroll to apply before RecentsViewScale
- Added new property in PagedOrientationHandler to apply both primary/secondary param without clearing the other, and renamed an existing method

Fix: 206972618
Test: Quick switching
Test: Launch task from grid, launch side task from carousel overview
Change-Id: I5977975ed1e930ad70b81d83513d8f3a00c0aed4
2021-11-19 14:42:20 +00:00
Lais Andrade
f6e31b1d21 Fix overview scroll triggering haptics on swipe up gesture
Add an extra check to the PagedView, before triggering the haptic
callback, to avoid triggering this when the scroll happens
outside an actual scroll action (e.g. some setter methods that update
the scroll state).

This was triggered on some calls to setCurrentPage, that was
snapping the current scrolled page and triggering the
View.onScrollChanged method.

Fix: 201237536
Test: manual
Change-Id: I9b29981dba408493c78873aea42d8615ea7573a0
Merged-In: I9b29981dba408493c78873aea42d8615ea7573a0
(cherry picked from commit bff03e2d0f)
2021-11-09 10:26:42 +00:00
Thales Lima
7a6752da51 launcher: create paddings for foldables
This creates a new padding file that bring some foldables up to spec
with VisD. For 2 panel layouts it now uses workspace margin instead of
cell layout padding.

Bug: 191879424
Fixes: 200035429
Test: checking paddings in HSV
Change-Id: I11b8e1afd76f535368d4c26e31630ce496171e13
2021-09-29 11:53:29 +01:00
Tony Wickham
bab101c818 Take panel count into account for page indicator size
Test: on a device with 2 panels, workspace page indicator width reflects number of needed scrolls rather than number of pages.
Fixes: 200607741
Change-Id: Ic2d0bdc644a15944c2d69a832068889071dc25e2
2021-09-20 15:13:33 -07:00
Tony Wickham
d552132d0b Reset RecentsView#mNextPage when swiping to home
This ensures that we don't inadvertently update mCurrentPage to be
mNextPage in computeScrollHelper(), which would in turn mess up
calculations such as RecentsView#getHorizontalOffsetSize().

Also removed resetNextPage parameter from forceFinishScroller(), as
resetNextPage was always passed as true anyway.

Test: Swipe up and to the right to home, ensure adjacent page goes all
the way off screen
Fixes: 199927699

Change-Id: Iee1ffac10e5195f0c3a124a23b06d5411ecd7ba2
2021-09-14 14:38:15 -07:00
TreeHugger Robot
81a3e6e7e7 Merge "Fix two dragging related bugs in Launcher home" into sc-v2-dev 2021-09-10 13:39:26 +00:00
Andras Kloczl
9732df1add Fix two dragging related bugs in Launcher home
- accessibility bug: 199394124
- dragging on side bug: http://shortn/_LFBdIllupk

Test: manual
Bug: 199394124
Change-Id: I478e31332119f337bf0f8b6c92926845eb4889c4
2021-09-10 12:16:03 +01:00
Thales Lima
02a5019cf3 Merge "launcher: correct page spacing for multiple panels in RTL" into sc-v2-dev 2021-09-10 09:53:40 +00:00
TreeHugger Robot
8f0de5d711 Merge "Introduces haptic feedback to launcher overview" into sc-v2-dev 2021-09-09 19:19:26 +00:00
Thales Lima
c2a6f6f4ae launcher: correct page spacing for multiple panels in RTL
Fixes 199043583
Test: manual testing in unfolded state in portrait and landscape

Change-Id: Idf5bdabb50742498701681e4654e72260054ab47
2021-09-09 19:13:19 +01:00
Lais Andrade
cc5c8843df Introduces haptic feedback to launcher overview
Haptics introduced at the key moments:

- Task scroll in overview or quick switch, trigger when a new task comes
to the center of the screen;
- Task scroll in overview when overscroll animation is triggered;
- Task dismissed in overview;

There is also a configured min gap between two scroll haptics set to
20ms to prevent fast scrolls from creating a chain of cancelled effects.

Fix: 182382085
Test: manual
Change-Id: I43c0f8c879a06f317e8a660240dafb7f7abe79f7
2021-09-09 14:08:01 +01:00
Sunny Goyal
bb0305614c Preventing workspace scroll over QSB area
Bug: 189792966
Test: Manual
Change-Id: Ie2fe8e7fb6c80b9cc19d517fe828cf26f54f6f09
2021-08-27 10:38:30 -07:00
Alex Chau
1e4484669d Remove widget panel
- Remove all usage of LEFT_PANEL_ID and fixed left panel code
- For preview renderer, load screen 0 + screen 1 instead
- Added a split display specific default workspace layout, with a placeholder app to pass test before we implement page pairing(b/196376162)
- Known issue: If screenId 1 is deleted, right panel will disappear from Wallpaepr & Style because there is no screenId 1. Will be resovled after page pairing(b/196376162)

Bug: 175939730
Test: manual and TaplTestsLauncher3#testWorkSpace
Change-Id: Icac1c94165c14a49c17897c45355b6cdc4d87e91
2021-08-13 21:48:35 +01:00
Andras Kloczl
b063294e60 Follow up CL for controller navigation fix
Fixing unresolved comment: http://shortn/_YCaiPNApNc

Test: manual test with a game controller, check on both normal and two panel home
Bug: 187205980
Change-Id: I8cae48effcce852c85273f16d1107dec90ff6f51
2021-08-03 14:03:58 +02:00
Andras Kloczl
7e91244a1b Fix controller navigation on two panel launcher home
Test: manual test with a game controller, check on both normal and two panel home
Bug: 187205980
Change-Id: I2515e476556098acf407c0bdcd634e3dd1cb308c
2021-07-29 22:04:27 +02:00
Andy Wickham
075c50e0c6 Merge "Doesn't scale PagedView snap speed during tests." into sc-v2-dev 2021-07-26 19:42:38 +00:00
Andy Wickham
da5a89b130 Doesn't scale PagedView snap speed during tests.
Settings.Global.getFloat causes a Binder
transaction which breaks BinderTests.java
when running it from Android Studio.

Test: BinderTests.java
Bug: 187428578
Change-Id: I07ce2fe256dba0bfa98a5dade538d68e7ce357ff
2021-07-23 23:08:46 +00:00
Thales Lima
e445774ab5 launcher: correct page spacing for multiple panels
This fixes 2 things:
- adding the correct space between pages as insets (eg camera) were
being discarded
- adding the space between pages instead of between panels as was before

This solution should work with more panels and don't create problems for
phones, where panels = 1.

Fixes 193194192
Test: manual testing in unfolded state in portrait and landscape, both
rotations

Change-Id: Ia3b148ceb773c6d5b6f8848ced07d7f9c1459e92
2021-07-22 09:41:43 +00:00
Andras Kloczl
77b3eb0acb Fix two panel accessibility issues
When two panel home was enabled in Launcher the items on
the left panel weren't able to get selected while on Talkback
because of an incorrect calculation in getScrollProgress.
Also the user was unable to jump to other workspaces by doing
simple one finger swipes because the page jump count was
only 1.

Test: manual
Bug: 174464170
Change-Id: I6cfe39b5059e8e7e7a32c9b0d372c658e796c3e8
2021-07-16 10:39:51 +02:00
Alex Chau
ba61b98fca Snap to relative position to snappd task when dismissing
- Calculate the diff to snapped page scroll and apply in onLayout, so tasks won't jump after dismiss when not in snapped position
- In grid, always keep the relateive snapped page unchanged to avoid jump

Bug: 188793333
Test: manual
Change-Id: Id11c2d700dc55440de39cc7409d06a712cedc9bc
2021-06-29 19:54:21 +01:00
Andras Kloczl
dbf577af46 Add left widget panel to Launcher home when unfolded
Test: manual
Bug: 175939730
Change-Id: I9831e7fa95084db12953ec7cb2eb725e7549e01d
2021-06-14 12:22:05 +02:00
Alex Chau
822acf4d25 Make quick switch track finger 1:1
- When calculating motion delta, it should consider the scale of pagedView
- Adjust significant threshold of tablet quick switch to 15% of page width (roughly 100dp)

Fixes: 188786242
Test: manual on quick switch
Change-Id: Idaa6c5b721decb573e97158c5fbcd67fa224f9d1
2021-06-03 18:07:52 +01:00
TreeHugger Robot
da91a85359 Merge "Revert "Add haptic feedback to Launcher recent apps scrolling"" into sc-dev am: f5af5ce11f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14793398

Change-Id: Ic5a7e1fc9f5ac07f84b10496b1f3ece2bf8e8b8f
2021-06-01 23:41:10 +00:00
TreeHugger Robot
f5af5ce11f Merge "Revert "Add haptic feedback to Launcher recent apps scrolling"" into sc-dev 2021-06-01 23:39:39 +00:00
Wale Ogunwale
0e25d2eba8 Revert "Add haptic feedback to Launcher recent apps scrolling"
This reverts commit b1ef5e5c55.

Reason for revert: b/182382085#comment4

Change-Id: I001944da64dc05324b14cc9dd3db5921faf8806c
Bug: 182382085
2021-06-01 22:10:18 +00:00
TreeHugger Robot
c3629c8e9c Merge "Cleanup state properly when interacting during gesture nav transition" into sc-dev am: b13200c6b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14735875

Change-Id: Icea54a23541cdd1791d9adc1c5dde67bbd6583c9
2021-06-01 21:31:25 +00:00
TreeHugger Robot
b13200c6b1 Merge "Cleanup state properly when interacting during gesture nav transition" into sc-dev 2021-06-01 21:02:29 +00:00
Tony Wickham
f8d731a808 Cleanup state properly when interacting during gesture nav transition
When the transition is canceled (e.g. when touching the nav bar during the transition), do the following:
- Abort the RecentsView scroll including the edge effects to ensure we get onSettledOnEndTarget() immediately.
- Jump to the current gesture end target state instead of the default rest state.

Test: Swipe up and to the left and hold to go to overview from an app, then swipe up to home during the transition; ensure that the touch down goes to overview rather than home, and subsequently that the swipe is respected and goes to home
Fixes: 189142339
Change-Id: Ie1d7dd05f45ab48968df7fdfd69fa1e1dda36d06
2021-05-26 15:28:38 -07:00
TreeHugger Robot
4daf838704 Merge "Add haptic feedback to Launcher recent apps scrolling" into sc-dev am: b1858afaf2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14678275

Change-Id: I99c4b7a85069a187db77d8dc51c6dee532a0681b
2021-05-26 18:21:58 +00:00
Lais Andrade
b1ef5e5c55 Add haptic feedback to Launcher recent apps scrolling
Add light LOW_TICK effects when the scrolling on RecentsView
snaps to a page, and a stronger TICK effect when the edges
absorb the scroll (by scrolling fast towards one of the edges).

Fix: 182382085
Test: manual
Change-Id: Ifb917ae499f73607707773f9870eb39cd6fe16ef
2021-05-26 13:37:30 +01:00
Andras Kloczl
55edfe55f7 Add two panel home support for page binding logic
There's a logic which prioritizes the binding for the
current page and defers the other pages' binding.
If two panel home is enabled, we want to bind both pages
together. LauncherPageRestoreHelper has been created to
contain the logic for persisting restoring and calculating
which pages to load immediately.

Test: manual + run LauncherPageRestoreHelperTest robo test
Bug: 174464691
Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
2021-05-24 23:22:06 +02:00
Winson Chung
76e27f6d5d Merge "End scroller if it has already reached the final position" into sc-dev 2021-05-11 21:52:45 +00:00
Winson Chung
8542541b2b End scroller if it has already reached the final position
- The system overscroller seems to take a long time to settle even
  after the final position has been reached, so if that has already
  happened and there is no edge effect, then just end the scroller.
- Remove unused code related to SmoothPageView

Bug: 184983443
Test: Quickswitch and ensure we finish the recents animation after it settles
Change-Id: I9fa72ddd6b6e0d38b6f622c776a2ac5f5b055760
2021-05-11 12:59:14 -07:00