Commit Graph

65 Commits

Author SHA1 Message Date
Brian Isganitis
3346e19b3b Initial Taskbar drag-n-drop support for search results.
- Includes initial support for obtaining PendingIntent for ITEM_TYPE_SEARCH_ACTION.
- Custom pre-drag conditions for search results can be provided through TaskbarSearchSessionController.
- Added detection for telling when DragView shift animation ends for
  pre-drag condition usage.

Test: Manual
Bug: 289261756
Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR
Change-Id: I52510a6f3ee49968134ecb591ef7c4df711b9d3d
2023-07-12 14:42:02 -04: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
vadimt
144a9508be Adding debug tracing for b/262282528
We see two long-clicks on the taskbar instead of expected one.

Bug: 262282528
Test: presubmit
Change-Id: I231d54ac08cf53ac7b0b6177da6b671314998021
2023-05-19 17:04:04 -07:00
Winson Chung
2e1ce4c72f Merge "Only set drag shadow params if they are valid" into udc-dev 2023-05-17 03:44:42 +00:00
Winson Chung
583de1621d Only set drag shadow params if they are valid
- Invalid params trigger an exception to be thrown when starting a
  system drag

Bug: 269016702
Test: Presubmit
Change-Id: I4b1953afd72ab1c6d41f3b5b536f9578ef40d792
2023-05-15 22:10:16 +00:00
Brandon Dayauon
e63401e711 Separate animations and add dragOffSet points in dragOptions
For 1, when animateShift() is called shiftAnimation() is the only thing needed.
2, by having point saved in preDragCondition, we can use that to update the drag layers and not have to
modify registrationX/Y later

Removed dragVisualizedOffset since it does not do anything.

There is an issue that also needs to be fixed if user decides to long click
on a search result and let go, the icon flashes at the touch point when you let go.. so we check when mContent can be shown in DragView
depending on if there is dragOffset.
If there is dragOffset, set mContent to invisible.
If there is no dragOffset, set mContent to visible because it doesn't matter as the original content is at the same spot.

bug: 245659929
test: manual: video: https://drive.google.com/file/d/1JQ0pud31HU0WlrqecX0v1cdPKQ37jQCf/view?usp=sharing
Change-Id: I4d2276b9c43e1e92c45d8538b8dde70baa84a5e8
2023-05-11 10:50:17 -07:00
Brian Isganitis
9c311b2917 Keep persistent Taskbar visible over Taskbar All Apps.
Additionally, this CL fixes some touchable insets issues with the
overlay window. Dragging and dropping is now reliable from taskbar while
All Apps or EDU is also open.

Change-Id: Ia612c1b5266a8fb2b7005a773fbd2b00ec4824db
Bug: 279465803
Bug: 275890048
Bug: 264463659
Flag: PERSISTENT_TASKBAR_OVER_TASKBAR_ALL_APPS (Teamfood)
Test: Taskbar is functional over All Apps and EDU.
2023-05-04 23:54:27 -04:00
Schneider Victor-tulias
bbe9ca616a Cleanup ENABLE_TASKBAR_POPUP_MENU
Flag: ENABLE_TASKBAR_POPUP_MENU
Fixes: 270392477
Test: opened a popup menu from the taskbar
Change-Id: I779e5410163aa1c9042d2fe128e0c528d168a964
2023-04-05 15:42:40 -07:00
Tony Wickham
c691dcba5a Don't stash immediately when drag was canceled
Instead, keep the taskbar open for the normal timeout.

Test: Drag an app from taskbar and drop back in taskbar, ensure taskbar
stays open until 5 second timeout; Drag an app from taskbar and drop
into split screen, ensure taskbar stashes immediately
Flag: ENABLE_TRANSIENT_TASKBAR true
Fixes: 275019813

Change-Id: I06ca0eccbfe313dbae8f6d96c7c09bb659f6a27b
2023-03-28 22:29:26 +00:00
Tony Wickham
89501aede7 Merge "Set PredictedAppIcon ring disabled when icon is disabled" into tm-qpr-dev am: f93aa98e3a am: b04aeba66b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22125079

Change-Id: Id47004d671ec6f4493217a9e50007b25296e1474
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-22 19:58:53 +00:00
Tony Wickham
1e29b04f19 Set PredictedAppIcon ring disabled when icon is disabled
Test: drag a predicted app from taskbar, ensure both ring and icon are
set to grayscale
Fixes: 268759548

Change-Id: I764ebcd486c09eceaf30c5bd5153a1dd2ff5be72
2023-03-22 16:53:10 +00:00
Tony Wickham
b83d56bc27 Merge "Fix taskbar drag view scale when returning to original icon" into tm-qpr-dev am: 3d1bb16493 am: c8207a7e23
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21533764

Change-Id: I4af1a2fe1e79d2f36d275a057178efd7e750b0e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 18:10:26 +00:00
Tony Wickham
3a36d4890a Merge "Fix a couple of drag and drop issues from transient taskbar" into tm-qpr-dev am: 2a567ec85a am: b506ae73b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21527497

Change-Id: I51be618db419357a60d0597f3f195ad284bd2c83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 06:22:44 +00:00
Tony Wickham
00f89fbbf6 Fix taskbar drag view scale when returning to original icon
- Use getSourceVisualDragBounds() if the target view is BubbleTextView;
  this accounts for padding as well as extra ring inset for
  PredictedAppIcon
- Also ensure we always use the final drag view scale when switching to
  the system drag and drop, instead of using the current scale which
  might be in the process of animating

Test: drag regular and predicted icons in taskbar, but drop it in a
region that doesn't accept it (e.g. the taskbar itself), check that the
return animation scales and offsets more correctly than before
Bug: 269814838

Change-Id: Ie8398b2617340e1d2568773563aa0263a3366940
2023-02-22 03:41:03 +00:00
Tony Wickham
16cfed3d1f Fix a couple of drag and drop issues from transient taskbar
- Don't stash until drag ends, but immediately stash at that point
  (regardless of success or failure, though failure will animate to the
  original icon before stashing)
- Send transient taskbar's bounds to WM Shell via intent extra such that
  they ignore drag events in that region

Test: manual in persistent and transient taskbar
Bug: 269814838
Fixes: 268526633
Fixes: 259645384
Change-Id: I5ded3998046f259ed6e79cb4ed765ad7b0c72e45
2023-02-22 00:46:51 +00:00
Chavi Weingarten
80995574bd Updated SurfaceSyncGroup API definition.
Test: Builds
Bug: 237804605
Change-Id: I0c1ebefb123d73df797fe6a6ee9eda456f1f0ccc
2023-01-12 16:12:10 +00:00
Chavi Weingarten
1906862d97 Pass in name for SurfaceSyncGroup to handle debugging better.
Test: perfetto trace and logs
Bug: 263340863
Change-Id: I40d887a071976e1506da9a06a1b50fa9b1394a27
2022-12-22 20:57:29 +00:00
Ikram Gabiyev
3d6c8de2af Merge "Remove on drag listener after drag ended" into tm-qpr-dev am: bb1e2a526a am: c9cb25ab3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20538917

Change-Id: I895c98ddcc0fc3c3c84708b9115f0537117a8f72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 19:46:09 +00:00
Ikram Gabiyev
7d633ecb07 Remove on drag listener after drag ended
Remove the on drag listener for the drag layer
in the taskbar after ACTION_DRAG_ENDED is received

This is an additional refactoring discussed
in ag/20490352

Bug: 258850827

Test: manually reproduced the steps in the bug
Change-Id: Ibe207001f41d3ba97a8acaf17d633cbd6682fafd
2022-11-22 06:07:09 +00:00
Brian Isganitis
a1585054e0 Merge "Do not start drag from pre-drag if cancelled during animation." into tm-qpr-dev am: 0ccbd7334c am: 5ff72eaa46
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20522179

Change-Id: I83fb16775b5080ed29fab628b7a4ddf7f3113237
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 19:27:17 +00:00
Brian Isganitis
0ccbd7334c Merge "Do not start drag from pre-drag if cancelled during animation." into tm-qpr-dev 2022-11-21 19:04:04 +00:00
Ikram Gabiyev
0de4950f04 Merge "Stash transient taskbar upon icon drag" into tm-qpr-dev am: 793c37153a am: 244d48097f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20490352

Change-Id: Ie56880bc1bcc4c116bcc5009cf77c5261384208c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-19 03:00:20 +00:00
Brian Isganitis
4ff301eb9d Do not start drag from pre-drag if cancelled during animation.
This change affects the preDragCondition for icons that do not have a
popup menu. The condition assumes we are still in pre-drag after
DragView is finished animating, but the user can cancel the drag in this
time (e.g. by releasing their finger early).

Test: Manual. Holding and releasing on suspended icon does not crash,
while holding and dragging still works as expected.
Fix: 258233476

Change-Id: Ic76f785cffcbfe0fe51eb1473022f2dc34563070
2022-11-19 02:32:08 +00:00
Ikram Gabiyev
c06426164f Stash transient taskbar upon icon drag
Transient taskbar needs to be stashed upon
dragging the icon from it to create a
splitscreen.

Bug: 258850827

Test: manually reproduced the steps in the bug
Change-Id: I88f2b4b25cb4c12fbe7e646a8ed668921ef24ab9
2022-11-17 22:01:41 +00:00
Vinit Nayak
0abb205fef Merge "Prevent dropping a drag from TaskbarAllApps in Overview" into tm-qpr-dev am: 50306445a1 am: f47e27ee4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20324839

Change-Id: I6c456545cba82946f5a92d4e7a1bcaa8b14c4d0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-14 19:39:53 +00:00
Vinit Nayak
eae4c99434 Prevent dropping a drag from TaskbarAllApps in Overview
* Don't close TaskbarAllApps once drag starts
(see comment in code regarding needing multiple shared drag
layers)
* Hide app menu split options for taskbar in overview
* One TODO is that the animation needs to be tweaked
because the scale of the icon when it's returned is too large.
* I think maybe we have to change the
TaskbarDragController#mDragIconSize since that gets directly
set from a resource. Unclear.

Test: Dragged in TaskbarAllApps in overivew and in split
select, app returned to original position and not taskbar
Bug: 251747761

Change-Id: I785f34b0bdb0b0abfc440450494074f8dfe7c31a
2022-11-10 16:17:26 -08:00
Vinit Nayak
6f4090cee1 Merge "Disable Drag from Taskbar in Overview" into tm-qpr-dev am: 626f322343 am: b7e684ecc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20259172

Change-Id: Ib9868ddc73158998c4000429faa966d32fc1b211
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 19:41:54 +00:00
Vinit Nayak
406bc6f247 Disable Drag from Taskbar in Overview
* Still need to disable drag from all apps in overview
* Disallow any taskbar icon long click when in split select

Bug: 251747761
Test: Drag from hotseat and predicted icons in overview,
snaps back to position

Change-Id: Ib9b068e4914b9197614c8e8f49b7899bb964f92b
2022-11-01 16:29:28 -07:00
TreeHugger Robot
f6b9723bd6 Merge "Add metrics sources for split invocation" into tm-qpr-dev am: e58e123bd7 am: 1c46220a98
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19820319

Change-Id: I1b7e2debef2cbe78f110403f7ce80e8873b28708
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 10:00:15 +00:00
Vinit Nayak
7fb4f997c4 Add metrics sources for split invocation
* See design doc in bug description for
usage/details

Bug: 231369744
Change-Id: I0c0ec11e924e387c523b5ac5feb7cabf78eaa748
2022-09-14 11:58:03 -07:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
vadimt
47f347b1cf Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877
Test: presubmit
Change-Id: I95c267e46cf675ac44dc27b07d0a1143ab761e35
2022-07-26 15:43:00 -07:00
Schneider Victor-tulias
2d1a071f16 Merge "Fade out the taskbar icons when animating to overview in 3 button nav." into tm-qpr-dev am: f6003ff070 am: de490c6bb1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19051009

Change-Id: I3c105a7632851acbb36be8607b51c23d9d3b2a0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 19:05:19 +00:00
Schneider Victor-tulias
3f6c473164 Fade out the taskbar icons when animating to overview in 3 button nav.
Bug: 231213105
Test: from home, opened recents, then went back home, then went back to recents, resumed an app, then went back to recents and resumed the same app (both in 3-button and gesture nav)

Change-Id: I83b1b33cafb95353f36a126b93fcaf3b536d3bf4
2022-07-19 11:35:37 -07:00
chaviw
3d1190a5b5 Refactor SurfaceSyncer so it now returns a SurfaceSyncGroup
Test: SurfaceSyncGroupContinuousTest
Test: SurfaceSyncGroupTest

Bug: 237804605
Change-Id: I4e7c1a1509cc64f2992fc07df0684d43fcf3dfc0
2022-07-01 14:01:28 -05:00
Schneider Victor-tulias
a36e5f13c0 Treat all apps predictions as all app icons when animating icons to their original position
Taskbar all apps predictions were being ignored when animating a cancelled drag to their original position. This was causing a null pointer since they no longer had a view parent that could be used. These icons will now animated to the taskbar all apps icon.

Fixes: 236669335
Test: cancelled drags of taskbar icons, predicted taskbar icons, taskbar all apps icons and taskbar all apps prediction icons
Change-Id: I2a9a1ed4120927a08b8c8341ad36dfdb95fef608
2022-06-24 12:22:04 -07:00
Sunny Goyal
32084d49d3 Replacing ItemInfoMatcher with predicate
This removed unnecessary componentName lookups when it
is not required. Many checks just rely on IDs and
userHandle

Bug: 231153610
Test: Presubmit
Change-Id: Ief93954abc5861062a9f55dc2ef181d3de106c62
2022-05-03 10:07:22 -07:00
Mady Mellor
729eb8458b Fix crash/flicker with taskbar when canceling drag and drop
The surfaceControl transaction is performed more than once so close
the transaction at the end of the animation.

Test: manual - start a drag from taskbar into split and then pull it
               back so that it doesn't complete
             => ensure taskbar doesn't flicker / no crash in logs
Bug: 228006271
Change-Id: I38c8efe310596bbbbf09f361c266a7fefc1b2eea
2022-04-15 20:25:35 +00:00
chaviw
29b8135260 Replace consumeNextDraw with SurfaceSyncer
Test: Builds
Bug: 200284684
Change-Id: I46e9cd89fd6b7c767bb867205400197b305e86a8
2022-03-18 16:20:42 -05:00
Schneider Victor-tulias
fb252e7ce1 Add taskbar TAPL tests
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices

Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
2022-03-10 13:02:35 -08:00
Tony Wickham
a56a197e14 Properly animate canceled deep shortcut drag back to original icon
- Added getFirstMatch() instead of using mapOverItems() (was a bit cleaner using ItemInfoMatcher)
- Match based on package name / UserHandle for deep shortcuts case

Test: drag deep shortcut from taskbar icon, inside folder, inside all apps; drag regular icons as well
Fixes: 222574524
Change-Id: Id5fdee29110f143c1125edc6945af09ab0a8d8ce
2022-03-04 00:39:38 +00:00
Brian Isganitis
1bc23b7662 Ignore touches in taskbar and all apps windows during system drag.
Touches are ignored as soon as we want to start system drag so that system drag can start sooner (i.e. before any AbstractFloatingView animations finish). This approach utilizes ViewTreeObserverWrapper's compute insets listener by temporarily setting the touch region to empty. The taskbar window remains fullscreen until the drag finishes so the touch region is reset at the right point. Similarly, the all apps window is kept open during its drag operations until the drag finishes. System drag state is now exposed through the drag controller to skip predrag.

Test: Manual by dragging to split screen and triggering dismissal
animation from both windows. Verified predrag works.
Fix: 221104066
Fix: 220070070

Change-Id: I424106269c841f58cbe5338d30b6c33fbd889019
2022-03-02 11:31:47 -08:00
Winson Chung
871759483b 1b/ Replace removed shared lib calls with direct calls
Bug: 219861883
Test: Builds
Change-Id: I7831d0de14286c9fa39fed59b168535e0a70d94d
2022-02-24 18:04:02 +00:00
Brian Isganitis
a1370bfc5f Put taskbar all apps in separate overlay window and stash taskbar.
All apps should display below system UI components such as the
notification tray and power menu, so an overlay window is more
appropriate. As a result, all apps has a separate window activity
context, but some properties are delegated to the taskbar activity
context. Taskbar should also be stashed while all apps is open.

Change-Id: I593457708779d84a0ab8b949a966d247d0a2e1b7
Test: Manual
Bug: 216843189
Fix: 217383817
(cherry picked from commit 473b980bf9)
2022-02-23 15:06:56 +00:00
Winson Chung
3516ecc534 Allow split with an existing split task
- Determine the task in the group being clicked in split-select mode
  and launch split using that selected task
- Also make sure we don't handle drag cancel twice when we are animating
  the return of the drag surface

Bug: 219060441
Test: Split from home/overview with fullscreen+fullscreen task, and with
      fullscreen+split task

Change-Id: I48ec0a82812197803ff4b3698830a9cb705719e3
2022-02-18 17:49:59 +00:00
Winson Chung
d937831791 Add basic return animation when drag is canceled
Bug: 179390870
Test: Drag, but don't drop to split an app from the taskbar and
      check that Launcher animates the surface back into place
Change-Id: I726855ff5bdffd1fc58d2839b3cc44b3fdb131e9
2022-02-09 06:44:21 +00:00
Brian Isganitis
4edf1da6e2 Introduce initial A-Z app drawer to taskbar.
Invoking the drawer is currently hooked up to tapping empty space on the
taskbar. Apps can be launched, and drag-n-drop split screen works. The
drawer can only be dismissed by acting on an app icon or tapping the
taskbar again.

Test: Manual
Bug: 204696617
Change-Id: I7c5fdbc7d54d8209f6f15ef80bfeb5e9b80cf647
2022-01-28 15:20:00 -05:00
Schneider Victor-tulias
bce63e06ed Merge "Fix taskbar icon dragging issues" 2022-01-25 19:03:06 +00:00
Schneider Victor-tulias
312b68fde4 Fix taskbar icon dragging issues
- Fixed icons disappearing when initiating dragging
- Fixed incorrect icon location when initiating dragging after rotating the screen to an orientation other than what launcher started in

Fixes: 215418478
Fixes: 214025075
Test: dragged icons from the workspace and taskbar
Change-Id: I848138af28802f7d806708c77c25b8de307c70d8
2022-01-20 14:56:01 -08:00
Schneider Victor-tulias
fa0bfee97a Add log dumps for taskbar state
Test: created bugreport and checked logs
Bug: -
Change-Id: Ic0c2330b18c8daf181ae5b236e0c4b212d630fa3
2022-01-20 14:41:25 -08:00