Commit Graph

363 Commits

Author SHA1 Message Date
Schneider Victor-tulias
bdae57c157 Fix janky Alt+Tab through overview animation
Flag: not needed
Fixes: 282172884
Test: used alt+tab in overview; also launched overview through keyboard quick switch view
Change-Id: I3d1e54cda317ee8f8d2b2d698480cd3ca01dfc85
2023-10-10 11:20:15 -04:00
Jagrut Desai
311d519292 Fix TaplTestsNexus#testSearchForApp
This cl is 1/2 part change

We are currently getting StaleObjectException when running this test.
We want to implment a synchoronized event beetween test and launcher,
so we know that search result adapter is done updating and page will
get no more updates of search results.

Test: Presubmit
Bug: 232008758
Flag: not needed
Change-Id: I40cf9b83d231a2487220aabc8f8e8c3ca71f255c
2023-09-13 11:09:05 -07:00
Kateryna Ivanova
7120373bbc Migrate Interpolators from Launcher3 to the public animation library
Test: atest
Bug: 271850966
Change-Id: Iba999f2e753764a37d35e508e707df02388432e9
2023-05-30 07:20:38 +00:00
Sunny Goyal
b7c0f3c386 Fixing overscroll getting lost due to float point comparision
When swipping back from overscroll, deltaX becomes close-to-0
causing the equality check (deltaX != 0) to fail. This
causes the overscroll to jump.
Platform views like HorizontalScrollView use int instead of
float to avoid this.

Bug: 273828110
Test: Verified on device that the overscroll finishes smoothly
Flag: N/A
Change-Id: I140750a2bdc39cebcbeb8ea83bb38efb0449dd5a
2023-03-17 13:30:59 -07:00
Andreas Miko
67372dff41 Merge "Add unlock animation for foldables" into tm-qpr-dev am: 121bbf6a3f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21487884

Change-Id: I52bb0c432b2f5cdabec90bfa23d3ec566406523b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-08 23:07:22 +00:00
Andreas Miko
121bbf6a3f Merge "Add unlock animation for foldables" into tm-qpr-dev 2023-03-08 22:40:22 +00:00
Andreas Miko
8e4192fa4f Add unlock animation for foldables
Test: Unit tests added
Test: Manual tests on foldable device going through unlock on outer and inner screens
Bug: b/261584499

Change-Id: I9cdb717400c82e7a0bb4d58d6d25d8b794200af3
2023-03-08 15:58:25 +01:00
Randy Pfohl
5864113904 Merge "fixing rare NPE" into tm-qpr-dev am: 1e42ff6353
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21692845

Change-Id: I073e7a3898fbd75d7af51e139a39ef3fcfb93705
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 23:52:15 +00:00
Randy Pfohl
583241e655 fixing rare NPE
test: replaced callback with null pointer and noted same crash error as provided in bug. testing crash to see if it was just small jank or obvious crash. its an obvious cash to user. by exiting earlier the UI isn't as fluid but we will stop crashing.

bug: 261071811
Change-Id: Ia54ee8d4bccdb9de8c042bae8e837216eaac67bb
2023-03-07 16:16:46 +00:00
Brian Isganitis
0c15dabc48 Merge changes from topic "running-in-test-camel" into tm-qpr-dev am: d2d2913812
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21725479

Change-Id: Iad48010b9309567049338220a2300cf85f7567c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-04 06:34:39 +00:00
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
c79e576824 Merge "Fix IllegalStateException caused by trying to snap to destination before initalizing page scrolls." into tm-qpr-dev am: 7e1144ee99
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20731930

Change-Id: Ibaa0cad2b3ff673a5d2c83f189e28c4637694ae3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-20 15:44:42 +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
0d5736e9b2 Merge "Add check for loading ever applied in check for page scrolls initialized" into tm-qpr-dev am: 8aa0471591
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20746686

Change-Id: I1dc8ce531281802027b88e99cedfe57b8562090c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-04 22:27:34 +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
Treehugger Robot
14946c1fa3 Merge "Fix errorprone warnings that should be errors" am: 35157974d4 am: 533b937fd3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/2254242

Change-Id: I748f2372116aa8bba282a0f1925e3968a9fed0ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-20 23:16:08 +00:00
Treehugger Robot
533b937fd3 Merge "Fix errorprone warnings that should be errors" am: 35157974d4
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/2254242

Change-Id: I6b47e8706afe05f5fdac403e79c87a533fbcc2c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-20 22:45:27 +00:00
Cole Faust
50ec4afe25 Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: If17d2944bfd3e7ab10592a4c74c956203c356f81
2022-10-16 13:35:16 -07: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