335 Commits

Author SHA1 Message Date
Suphon Thanakornpakapong
11e1a2fdc8 Merge remote-tracking branch 'aosp/android12L-release' into 12.1-dev 2022-05-08 20:29:17 +07: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
Suphon Thanakornpakapong
cf0ef6e562 Fix PagedView crash below Q 2021-10-29 01:06:41 +07:00
Suphon Thanakornpakapong
8312e91889 Use stretch overscroll in workspace 2021-10-11 23:24:05 +07: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
András Klöczl
45e72a1ed3 Merge "Fix launcher navigation issue when using a controller" into sc-dev 2021-05-11 10:01:43 +00:00
Andras Kloczl
359d1aedae Fix launcher navigation issue when using a controller
When navigating in Launcher home using a controller,
the mCurrentPage variable isn't updated properly which
results in out of order navigation.

Test: manual
Before: http://shortn/_c8A8mKiplN
After: http://shortn/_ctxIaweqZY
Bug: 187205980
Change-Id: I9ff4019b608e999749c4d0835cc3ceb35be93a3f
2021-05-11 09:52:24 +02:00
Sunny Goyal
5996937798 Removing Launcher dependency from Folders
This allows opening/closing folders without a Launcher context

Bug: 187353581
Test: Manual
Change-Id: Id73a40445a23004eb554f0422d286aa0ff6b3c41
2021-05-10 14:01:43 -07:00
Sunny Goyal
b745a2a9fd Fixing transition end not getting called if pagedView is not drawing
Bug: 186822776
Test: Manual
Change-Id: I60e9028d17f39a4ad95f9aa79f8b4be695b4ae65
2021-04-30 13:38:59 -07:00
Sunny Goyal
05b59c080f Calling pageTransisionEnd only after edgeEffect finishes
Bug: 186605795
Test: Presubmit
Change-Id: I2b46d0b0a47c68038f300e71ab89bd7e5a5e3895
2021-04-29 13:56:08 -07:00
Sunny Goyal
c39db7321f New spring overscroll in pagedView
> Using EdgeEffect in PagedView for overscroll
> Keeping RecentsView overscroll similar to S, by created a custom EdgeEffect

Bug: 183966408
Test: Manual
Change-Id: Ia547cf14ea315468b12a4ff5f389ac2d2beceafa
2021-04-22 16:28:30 -07:00
Andras Kloczl
7a1ca0b299 Launcher home currentpage refactoring
Calling cancelLongPress on all the visible pages when needed
and enabling hardware acceleration on them when a folder
animation is in progress.

Test: manual
Bug: 174464691
Change-Id: Ib11265abfd184fed41acc9a6347a32aec12895f2
2021-04-09 11:22:14 +02:00
Alex Chau
b5c4d1108f Changes page alignment in PagedView calcualtion
- Align pages to right (instead of left) in RTL, to make scroll calculation for grid overview easier for out of orientation tasks
- Changed TaskView pivot direction to be consistent with page alignment
- Add scroll offset for ClearAllButton to align to left in RTL
- Fixed Workspace scroll issues in RTL, and removed needs to use panelCount when calculating page scroll

Bug: 175939487
Test: Test carousel/grid overveiw, Workspace, Folder scroll view for normal/RTL
Change-Id: Ic0ba88e5d58638e1149d97a68a978d80fbf26774
2021-03-30 12:05:16 +01:00
Alex Chau
dedbc8ac36 Remove grid scaling in Overveiw
- Grid scaling has problem that scales task icon and menu, which makes it hard to control icon size and text size in the manula
- Replaced the whole concept with dedicated Task size calculation in grid layout
- Support different icon size in TaskView in grid and removed task_thumbnail_top_margin
- Removed grid progress in TaskViewSimulator as well
- Refactored how ClearAllButton scroll and translations are calcualted to align clear all properly in grid
- Make page center calculation aware of PagedView pivot and scaling

Bug: 174464863
Test: Manual on two screens
Change-Id: I47b13ef6e55c6e16c52ea04225f5bde02ed82fc2
2021-03-24 18:46:32 +00:00
Andras Kloczl
a4cb0f02de Fix staggered animation on right panel home screen
Recently we have added support for multiple panels
on the home screen but the current StaggeredWorkspaceAnim
logic only supports animation for the leftmost panel.

Test: manual
Bug: 183032642
Change-Id: I539e1c1a26292b75801eb3070e22f0fbde1ebc7e
2021-03-24 12:37:22 +01:00
Andras Kloczl
2bb5134413 Fix widget scrolling issue on right panel
Since we added support for multiple panels on the home screen,
we need to call cancelLongPress on all the visible pages not
just on the leftmost visible page.

Test: manual
Bug: 178582378
Change-Id: I88ded543a16b1bbf2a53a627e5725f68b42e742b
2021-03-22 17:39:06 +01:00
Andras Kloczl
8e57cce4ee Two panel & two page swipe & currentPage fixes
- Pagespacing set to 0 to have similar design to figma
- Added padding to left side of left panel and right side of right panel to match figma
- getPageScrolls changed to support two page scrolling
- validateNewPage changed so that only even indexed pages can be switched to
- getPageWidthSize added for measurements, it returns half screen width when two panel is active
- onMeasure changed to use getPageWidthSize
- panelCount has been increased from 1 to 2 when two panel is active
- add feature flag for two panel home
- shouldConsumeTouch changed so not only currentpage is checked but currentpage+1 screen as well
- add one more extra check for setDropLayoutForDragObject for currentpage + 2, next to right panel
- using new grid option for two panel home screen

Test: manual
Bug: 174464115
Change-Id: I1bad7eecc67f65fb833608744a5aa5aca65373b4
2021-03-17 12:19:02 +01:00
Steven Ng
ae6b34811b WidgetCell & LiveWidgetPreview cleanup
The fixes are:
1. For widgets shown in TableRow, aligns them center vertically.
   This is useful when widgets of different height are shown in
   the same row.
2. Remove background color from WidgetCell
3. Re-enable swipe in FullWidgetsSheet
4. Use the WidgetCell image as the single & long press area because
   1. Previews are now scaled to their default size. The touch area
      should already be larger for widgets that are bigger than 2.4
      cells
   2. WidgetCells also render description. If the user long press the
      description area, the drag view will not align in the middle of
      the user touch / drag area.

Test: Drag-n-drop widgets from FullWidgetsSheet, BottomWidgetsSheet
      and pin widget flow.
      In FullWidgetsSheet, swipe left and right to switch work /
      personal tab.

Video: https://drive.google.com/file/d/1Ur7PwF1a7iwGGRTZczfc0BSVu-Ta6-Vm/view?usp=sharing

Bug: 179797520
Change-Id: I6fe4bc88d1e1b35b1819d8d7f046105f5ed27043
2021-03-08 21:22:08 +00:00