Commit Graph

438 Commits

Author SHA1 Message Date
Holly Sun 35b9960b63 [a11y] Fix crash when using talkback to add to home screen.
1. Fix a crash from http://cs/android-internal/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java;l=1928;rcl=d677caa75de74f1c3a88367cad67ae405fd2903d. It can also be `ITEM_TYPE_SEARCH_ACTION`. Remove the `itemType` check and just use the `PendingAddItemInfo` class type.
2. Override `startConfigActivity` in `PinShortcutRequestActivityInfo`, so that `Launcher#onActivityResult` can be triggered properly from `Launcher#processShortcutFromDrop` (http://cs/android-internal/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java;l=1939;rcl=d677caa75de74f1c3a88367cad67ae405fd2903d )
3. Then we call to `Launcher#completeAdd` -> `completeAddShortcut`. The original `info` passed to `processShortcutFromDrop` doesn’t have a `componentName` (new code), so remove the component non-null check from `completeAddShortcut`.

Bug: 287166186
Bug: 287167527
Bug: 287166771
Test: manual
Flag: N/A
Change-Id: Id3e1444de188f2d2af760f58e3d9814a2b7abd88
2023-06-30 08:42:31 -07:00
fbaron 4ac0379f8b Add themed work badge for themed icons in dragview or floatingiconview
Bug: 288491653
Test: Verify that dragging icons with work badge have the right badge theming and that when the icons are animatng (e.g swipe to go back home from app) have the right themed/non-themed work badge
Change-Id: I3d75e83ebab0d99866f1fe3688dc06bb7e933a6e
2023-06-23 15:22:12 -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
Charlie Anderson afb447ee0d Merge "Adding a new Edit Mode LauncherState" into udc-dev 2023-05-16 18:42:34 +00:00
Charlie Anderson 438d405aab Adding a new Edit Mode LauncherState
- Edit Mode doesn't close after dragging / dropping an app
	- Edit Mode can be entered through options popup menu, Spring Loaded still entered by dragging items
	- Adds new onLeavingState call to launcher states to cleanup changes

Bug: 279590398
Flag: MULTI_SELECT_EDIT_MODE
Test: manually tested the new state with flag on/off

Change-Id: If4550037f9659dcb8cd8b1943388d1ec5d55fa29
2023-05-12 14:54:45 -04: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
Sunny Goyal 2185f6f420 Loading widget description on the background thread
Bug: 281074741
Test: Varified on device
Flag: N/A
Change-Id: I6b9b13e712534bdc582b98dbfb7bdfcc40d2f19d
2023-05-05 23:15:41 +00:00
Schneider Victor-tulias fff7cef9f1 Remove unused debug logs
Removing debug logs for bugs that have already been closed. These logs are filling up the logcat buffer and impeding in other test investigations.

Flag: not needed
Test: Tapl tests
Bug: 260260325
Change-Id: I4d69b904f2ea79d758cf6bef7d90d172f2eb2a91
2023-04-25 11:00:37 -07:00
Sunny Goyal 89a272fd0d Merge "Updating PinShortcutRequestActivityInfo to provide pinRequest lazily" into tm-qpr-dev am: e1471d3acd am: 6589b4020b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22318893

Change-Id: Ia7720436df295ba130410cd8ba5237585d676fa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 06:34:14 +00:00
Sunny Goyal 13a6b228a5 Updating PinShortcutRequestActivityInfo to provide pinRequest lazily
Bug: 275407282
Test: Verified on device
Change-Id: I81867ada454219b44663b58b942329422fb81196
2023-03-28 13:28:34 -07:00
Brian Isganitis 8ecb5eeb62 Merge changes from topic "running-in-test-camel" into tm-qpr-dev am: d2d2913812 am: 0c15dabc48
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21725479

Change-Id: I3d02a42c2d0bdebc2487def8696d9a489aca7311
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 00:08:07 +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
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 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
Sunny Goyal 9411e22e39 Merge "Adding support for customizing shortcut pinning logic" into tm-qpr-dev am: 85d15e78d0 am: ba88f8f880
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21325312

Change-Id: I2833a14e1554a62d02b000a1a2218da8f4eb0505
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-20 20:33:19 +00:00
Sunny Goyal 239d6e9b8d Adding support for customizing shortcut pinning logic
> Allowing support for overring shortcut badge
> Updating pendingShortcutInfo so that the
  handler can be easily overridden

Bug: 268253894
Test: Verified on device
Change-Id: I3184cb6494bc98c7eed33798b35b4e6e6a1e7ddc
2023-02-17 18:07:23 +00:00
Federico Baron 1cbb2bec7d Merge "Fix bug where dragging icons in folders causes error" into tm-qpr-dev am: 7cb0133d84 am: e80898c6f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20806533

Change-Id: I6c92b40e5e25b4fba30ecdf6d7b3afd8fc810a3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-04 23:51:25 +00:00
Federico Baron 7f823d10b4 Fix bug where dragging icons in folders causes error
The error was caused by delta being larger than the range, which leads to an UnsupportedOperationException: "Final position of the spring cannot be greater than the max value". With this change, delta will never be greater than range.

Fix: 261674632
Test: 1. Settings > Display > Display size and text >>> Set display size to the biggest
2. Make folder
3. Go to landscape mode
4. Open folder
5. Quickly drag icon in folder
6. Verify that Launcher doesn't stop and drag is successful

Change-Id: I6c81755750acf0de8693b98caad8e7dab3e9f58a
2022-12-22 22:51:28 +00:00
Sihua Ma 45149d9036 Merge "Add QuickstepWidgetHolder for widget handling" into tm-qpr-dev am: 04c89fe38e am: f8ab32a8bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20418248

Change-Id: I8cc2d48f94aaa415fb7b9bd8137502b27de33d5d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-19 19:55:49 +00:00
Sihua Ma 04c89fe38e Merge "Add QuickstepWidgetHolder for widget handling" into tm-qpr-dev 2022-12-19 18:22:38 +00:00
Sihua Ma 1db8bc2467 Add QuickstepWidgetHolder for widget handling
Fix: 235358918
Test: Manual
1. Rebooted the device and verified that widgets are still updating properly
2. Changed the theme from dark to daylight, then from daylight back to dark and verified that widgets are working
3. Kept the device on for several days and verified that widgets are still updating
4. Turn on auto-rotate for the launcher, open any app then exit, verified that widgets will not vanish and reappear
5. Add & remove widgets from the screen, added widgets are still updating

Change-Id: I98ee902f7d16b47bd77626201a4fefc897ba17a0
2022-12-16 11:56:36 -08:00
Schneider Victor-tulias 673d6a01ed Merge "Revert "Cancel gestures on launcher destroy"" into tm-qpr-dev am: ad48decd4f am: d132ad4393
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20664263

Change-Id: I13f6d462dc8fabc0010661aea379bcf2357f9a24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 15:47:36 +00:00
Schneider Victor-tulias ad48decd4f Merge "Revert "Cancel gestures on launcher destroy"" into tm-qpr-dev 2022-12-08 14:55:15 +00:00
Schneider Victor-tulias f0de6cc2ca Revert "Cancel gestures on launcher destroy"
Revert "Refactor SchedulerCallback implementation"

Revert submission 20555112-launcher-destroy-gestures

Reason for revert: causes test failures
Reverted Changes:
Ib43cdd597:Refactor SchedulerCallback implementation
Ia8e936e26:Cancel gestures on launcher destroy

Change-Id: I2199e39237b7c9fe25784b46e16960cd5f17c46c
2022-12-07 19:46:00 +00:00
TreeHugger Robot 036fe83e63 Merge "Cancel gestures on launcher destroy" into tm-qpr-dev am: c4d6dee069 am: f77ad4afd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20555112

Change-Id: Ia4e2a6627346fd949a7001c5bbdddbe3f41bb474
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 21:46:08 +00:00
TreeHugger Robot c4d6dee069 Merge "Cancel gestures on launcher destroy" into tm-qpr-dev 2022-12-05 20:25:47 +00:00
Schneider Victor-tulias 65dda6d03e Cancel gestures on launcher destroy
A wide variety of gesture navigation bugs were caused if launcher happened to be recreated mid-gesture and we didn't handle it gracefully. Updated lifecycle callbacks to immediately cancel the ongoing gesture if launcher is destroyed.

Fixes: 244593270
Fixes: 257976590
Test: forcefully(programmatically) recreate on every other gesture nav handle touch down; check that following gestures are not broken and animations are not frozen
Change-Id: Ia8e936e26a42cfe26fc6bcd9eefb25d37bc08749
2022-12-05 08:11:50 -08:00
Sihua Ma 6cf21e462a Merge "Replace title of system services with more specific ones" into tm-qpr-dev am: 7b467addea am: 57489b5c3a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20592089

Change-Id: Iac15925302705a405e16abaebec8f106c8cf66c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-03 07:21:27 +00:00
Sihua Ma 8820a2181b Replace title of system services with more specific ones
Before: https://screenshot.googleplex.com/8f5tGuw8c8zi6nX
Now: https://screenshot.googleplex.com/4SXGMoiZmYJ3auF

Fix: 258307358
Test: Manual
Change-Id: I549cbdbb99f0168c87cc1c122cad9aceb3231591
2022-12-01 14:37:47 -08:00
Sihua Ma 460b85f101 Merge changes If022ec8d,I34341937 into tm-qpr-dev am: c6bd4ad21f am: 1d678ad179
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20418246

Change-Id: Ib5183feebded858d4ebce4693d47d62151bb2899
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 02:13:21 +00:00
TreeHugger Robot 92f4d20e48 Merge "Removing unnecessary event dispatching via touch-controller. Instead using a poll method similar to other touch controllers" into tm-qpr-dev am: 579ddc7aff am: 8c8f96d452
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20500613

Change-Id: I2c093b2767fc736d40a5370dc8384374848d483e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 02:05:43 +00:00
Sihua Ma c6bd4ad21f Merge changes If022ec8d,I34341937 into tm-qpr-dev
* changes:
  Move LauncherWidgetHolder to widget package
  Move most of the functions in LauncherAppWidgetHost to LauncherWidgetHolder
2022-11-17 01:46:55 +00:00
Sihua Ma 8bbfcb6581 Move LauncherWidgetHolder to widget package
Making LauncherAppWidgetHost package-private as well

Bug: 235358918
Test: N/A
Change-Id: If022ec8d429579a972991872b2dc11db76719341
2022-11-16 14:31:14 -08:00
Sihua Ma aa2b872d1c Move most of the functions in LauncherAppWidgetHost to LauncherWidgetHolder
Test: N/A
Bug: 235358918
Change-Id: I343419376491203a195154f2766b12e5def38879
2022-11-16 14:30:08 -08:00
Sunny Goyal 6abdd5c735 Removing unnecessary event dispatching via touch-controller.
Instead using a poll method similar to other touch controllers

Bug: 259447608
Test: Verified on device
Change-Id: I5c29c7c1b87acb668ea93e9f44fb685379de54fb
2022-11-16 13:58:05 -08:00
Sunny Goyal c2d79ed34e Merge "Adding support for multiple overlay callbacks" into tm-qpr-dev am: 8d3241b359 am: d5bb6459f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20362704

Change-Id: Ic27caf598e09cd5fc8f5d13fc547398d8faf3d85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-04 15:10:35 +00:00
Sunny Goyal 82379187ea Adding support for multiple overlay callbacks
Bug: 193244407
Test: Presubmit
Change-Id: Ic345972056752238e7e46226533fd8f33d664213
2022-11-03 14:37:40 -07:00
Sebastián Franco 8f357c149e Merge "Moving the class LayoutParams to a file outside CellLayout" into tm-qpr-dev am: 73b8ee9390 am: 5e8c248e1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20122918

Change-Id: I51de393340bf6fa5537a145a71ec9d46d4e2beff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-14 21:46:41 +00:00
Sebastián Franco 73b8ee9390 Merge "Moving the class LayoutParams to a file outside CellLayout" into tm-qpr-dev 2022-10-14 20:43:34 +00:00
Sebastian Franco d468299c0f Moving the class LayoutParams to a file outside CellLayout
I'm moving the LayoutParams to another file to start the decoupling
of the Reorder outside of the CellLayout.

Also, I change the name from LayoutParams to LauncherLayoutParams to prevent confusion with ViewGroup.LayoutParams making it explicit that this are different LayoutParams.

Bug: 188081026
Test: atest ReorderWidget
Change-Id: I92251c5540ffcf5ece7b933e6f6c836eb825c997
2022-10-12 16:14:42 +00:00
Brandon Dayauon 1e5fcc1909 Merge "Scale icons from search to make app icons big like AA -> workspace" into tm-qpr-dev am: 956851e7ca am: 215ddb9b92
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19774829

Change-Id: Id68d31a6f91dd99b85bf4943998834d4fa25a917
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-11 23:39:30 +00:00
Brandon Dayauon d3755f46cc Scale icons from search to make app icons big like AA -> workspace
when dragging from search.

To scale the icon during dragging (instead of long press) I created a scale variable within DragOptions
so that right before dragStart gets called in DragController.java (in callOnDragStart())
the dragview scales before dragging..
 * note: the scale from search is 1.687 and the scale from allApps is 1.107
- included searchResult and smallSearchResult
- Added animation for scaling icon (used Interpolators.EMPHASIZED 500ms as suggested by motion designer)
- Cancel animation when drag finishes

bug: 222666176
test: Manual - after: https://drive.google.com/file/d/1ZZHnXlzdTxlM-RUIdJ6EOYkPPg6tCUxC/view?usp=sharing
before: https://drive.google.com/file/d/1NpBz3kT_slHXtpXObr_G8K6SZYG9_bLX/view?usp=sharing

Change-Id: I01309a3be928987ba00422ad947b80a3df865973
2022-10-11 13:29:35 -07:00
Andras Kloczl 0e4f04d85f Fix flaky/failing two panel TAPL tests
Since Cuttlefish emulators are quite slow, some
of the two panel related TAPL tests were failing
due to multiple page changes instead of single ones.

Test: atest -c NexusLauncherTests:com.android.launcher3.ui.workspace.TwoPanelWorkspaceTest
Bug: 236136463
Fix: 252747355
Change-Id: Ib154cf97040fcea3b4d2d7082352c06de74f8c2a
(cherry picked from commit 486f7c8766)
Merged-In: Ib154cf97040fcea3b4d2d7082352c06de74f8c2a
2022-10-10 10:52:16 +00:00
TreeHugger Robot abda780906 Merge "Updating the title of the Add to homescreen prompt to the requesting app instead of the Launcher name" into tm-qpr-dev am: 17c4741432 am: 4e758bfc23
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19980314

Change-Id: I6a3e8e4479d9ac04a59b924ef5dc9e0264e27485
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-17 02:39:10 +00:00
Sunny Goyal bb5ebb7f2d Updating the title of the Add to homescreen prompt to the requesting app
instead of the Launcher name

Bug: 239055068
Test: Verified on device
Change-Id: I1494d911565ddf3a598f9fbf372b8d784a4276e4
2022-09-16 15:54:53 -07:00
András Klöczl 6410602190 Merge "Fix flaky two panel TAPL tests v2" 2022-08-09 08:40:57 +00: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
Andras Kloczl a9ecc3d1bd Fix flaky two panel TAPL tests v2
Cuttlefish emulators are getting slower and slower and some
of the two panel related TAPL tests were failing
due to multiple page changes instead of single ones, so
we need to increase the page change hover time in the tests.

Test: atest -c NexusLauncherTests:com.android.launcher3.ui.workspace.TwoPanelWorkspaceTest
Bug: 236136463
Change-Id: I8007a73a17089a7f7a639ce615af52695b55002c
2022-07-21 07:29:13 +00:00
Andras Kloczl 486f7c8766 Fix flaky/failing two panel TAPL tests
Since Cuttlefish emulators are quite slow, some
of the two panel related TAPL tests were failing
due to multiple page changes instead of single ones.

Test: atest -c NexusLauncherTests:com.android.launcher3.ui.workspace.TwoPanelWorkspaceTest
Bug: 236136463
Change-Id: Ib154cf97040fcea3b4d2d7082352c06de74f8c2a
2022-07-11 13:09:13 +00:00