Commit Graph

1073 Commits

Author SHA1 Message Date
Sebastian Franco
a955403ba9 Change the access of cellX/Y of CellLayoutLayoutParams to private
Cherry pick needed for changes on workspace lily

Bug: 188081026
Test: no op change, should compile
Test: ReorderWidgets
Change-Id: I20367974e5a4cead406e18eb66dafd4d59651b2a
2023-01-11 15:25:23 +00:00
Sebastian Franco
f34f35fddb Printing the workspace items to improve flake investigation.
Recording the screen to investigates flakes on ReorderWidgets
is really useful but it requires changing the code for that and
storing the video and most of the time the useful information
is just the end state so by logging the end state makes resolving
flakes easier

Fix: 261877803
Test: atest ReorderWidgets
Change-Id: If5d9745ebb57826a55b5df9d3599eed56c48298f
2023-01-06 12:29:11 -06:00
Sebastian Franco
5356ff955c Creating a new alarm when drag X,Y change
If the user is changing the X and Y of the reorder, wich requires
the user to move at least one Workspace cell from the previous
position, then it doesn't make sense to wait for the previous alarm to finish
to start a new reorder.

Also, I added a new test to run on foldable devices.

Fix: 259995663
Fix: 259295374
Test: atest ReorderWidgets (it mostly fails on postsubmit)
Test: modify ReorderWidgets.fullReorder to run 20 times and it should work, before the chagne it would fail.
Change-Id: Ic6b436ea1088f8092c849e9791862947e9035c9f
2022-12-05 16:37:45 -08:00
Sebastian Franco
2ceb3b5088 Adding screen ID parameter in CellLayoutLayoutParams
Bug: 188081026
Test: launcher compiles, this test doesn't change existing logic only the model
Change-Id: I7bcf6452d5ecb9b50914defc311ad06839220c92
2022-12-02 13:40:34 -08:00
TreeHugger Robot
691c6e511f Merge changes from topic "revert-20479526-revert-20427045-258023561-BPDASTWITO-FBDWZBDEFC" into tm-qpr-dev
* changes:
  Fixing the revert by not continuing the reorder if the solution is null.
  Revert "Revert "Reorder widgets no longer overlaps when no space..."
2022-11-22 21:18:42 +00:00
Xiaowen Lei
6d66ad20cf Fix issue in RTL where swipes on Launcher Smartspace are intercepted.
The `+ getScrollX()` translation is a duplicate, because
`mapCoordInSelfToDescendant` also does it internally. Same for the `+
getScrollY()`.

This wasn't an issue in LTR because the top left corner of the root view
is the same as the top left corner of the first page.  `getScrollX()`
returns 0 in that case.

In RTL, the second page is to the left of the first page. If the touch
is on the first page, `+ getScrollX()` translates it outside of the
first page. This incorrectly sets mIsEventOverFirstPagePinnedItem to
false, leading to the swipe being intercepted.

Bug: 240380590
Fix: 240380590
Test: manual
Change-Id: I51f534695401ce527da8d2158130a4d54b086f3d
2022-11-21 23:52:20 +00:00
Sebastian Franco
02b4711e74 Fix issue where the solution is not updated when the grid is empty
Test: Manually move widgets and shortcuts around and the position should match the animation
Fix: 259502044
Change-Id: I20a98f9366394c840bb3cd0577de26a181a229ac
2022-11-17 14:23:09 -08: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
Sebastián Franco
f9a6ac241a Revert "Revert "Reorder widgets no longer overlaps when no space..."
Revert "Revert "Reorder widgets no longer overlaps when no space..."

Revert submission 20479526-revert-20427045-258023561-BPDASTWITO

Reason for revert: Fix the issue that caused the first revert.
Reverted Changes:
Icecfd1d34:Revert "Reorder widgets no longer overlaps when no...
I4cc552588:Revert "Reorder widgets no longer overlaps when no...

Change-Id: I47c4cde42c19f50e2834660d843a8e2ae571c03c
2022-11-15 22:56:41 +00:00
Sam Dubey
3dad4fec9f Revert "Reorder widgets no longer overlaps when no space is avai..."
Revert "Reorder widgets no longer overlaps when no space is avai..."

Revert submission 20427045-258023561

Reason for revert: Likely causing NPE while running launcher shortcut tests (Part of DM+Platinum monitor rotation. The revert won't be submitted if proven otherwise)

Bug: 259234533
Reverted Changes:
Ie599f7cb7:Reorder widgets no longer overlaps when no space i...
I04b262ecc:Reorder widgets no longer overlaps when no space i...

Change-Id: I4cc552588c8099356bc3f05c4c63d17a524f2a24
2022-11-15 13:24:19 +00:00
Sebastian Franco
592e2691f6 Fix the wiggle reorder aniamtion stopping if dragging
We were using the minimum span to calculate the cell position
of the widget and if you move slightly because the minimum is usually smaller than the current size it would calculate wrong cell positions
that are change more frequently because it's smaller.

Also, I went back and moved
performReorder(... CellLayout.MODE_SHOW_REORDER_HINT) with the
alarm if block as it was before one of my refactors, it still works
if they are separate but is harder to think about the logic if they
are divided so it's better to all be in one block.

Fix: 255421416
Test: manual testing, reordering and making sure the animation is playing well.
Test: atest ReorderWidgets (to make sure the reorder is not broken)
Change-Id: I3eff5bc9f21fda8f2f8908380397d8639ac15ff9
2022-11-10 21:53:33 +00:00
Sebastian Franco
893615f241 Reorder widgets no longer overlaps when no space is available
In the previous refactor I got confused between findNearestVacantArea
and findNearestArea thinking the later did the former. So it ignored the occupied spaces and treat it as a solution.

Changed the names to prevent further confusion.

Fix: 258023561
Test: manual, need to add this case to ReorderWidgets
Change-Id: I04b262ecce168d5c93a9d66ef62d5b0e148e38b6
2022-11-08 19:02:15 +00:00
Sebastián Franco
c3cefebab4 Merge "Ensure that the reorder preview and what gets submited uses the same solution." into tm-qpr-dev 2022-11-04 17:45:28 +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
Sebastian Franco
5d990eedfd Ensure that the reorder preview and what gets submited uses the same solution.
Design doc: https://docs.google.com/document/d/1RsId9OFGgkcImkkmDwWZBBvITWnGlxKVqniE3cimkqY/edit#heading=h.xzptrog8pyxf

As can be seen in the diagram in b/256770363 on every reorder the
first call in the process is MODE_SHOW_REORDER_HINT so if we make
sure that only then a solution is calculated and we reuse that
solution in the rest of the calls in the same reorder then we would
have more consistency and the animation will always be the same and
the logic state.

Fix: 256770363
Bug: 188081026
Test: atest ReorderWidgets
Change-Id: I93a1d09f5b8cbfbc461043ee3fc41b1cab294fed
2022-11-03 14:11:01 -07:00
Sebastián Franco
0c3f990b34 Merge "Decoupling finding the solution and animation of a reorder in CellLayout" into tm-qpr-dev 2022-10-31 23:02:44 +00:00
Sebastian Franco
53a15a4b1f Decoupling finding the solution and animation of a reorder in CellLayout
Adding new functions to CellLayout, two of them return a solution
(calculateReorder, getSimpleReorder) and the other one takes a
solution and animates that solution (void performReorder) and it can
either submit the solution or just show it for a preview.

Right now this two things are done under the same function:
int[] performReorder. The need to separate this two functions is
because to add this functionality b/188081026 which needs to find
soluion without animation and animation solutions that can be
calculated in another place.

Bug: 188081026
Test: atest ReorderWidgets
Change-Id: Ib519d4346f58f9b55aff5008cd3ccbcfe8443d2d
2022-10-28 11:55:50 -07:00
Sihua Ma
0593a0d3ec Created LauncherWidgetHolder as a wrapper for LauncherAppWidgetHost
The wrapper class is created for further changes that will run the wrapped host in the background.

Test: N/A
Bug: 235358918
Change-Id: I9bd6fc2749c5d4a4d3391fb75d0c3ff1e13d17bf
2022-10-26 10:57:13 -07:00
Federico Baron
0abfda8f2f Rename first page pinned widget to mFirstPagePinnedWidget
mQsb is the name used for the first page pinned widget. This variable name is bad since in some launchers the first page pinned widget is a qsb but sometimes it is a smartspace. Renaming the variable to mFirstPagePinnedWidget is a more accurate name for this variable.

Bug: 251259222
Test: N/A
Change-Id: I6d3c74163995d2267510ee546924917062c4955c
2022-10-21 13:01:24 -07:00
Federico Baron
a56f08e677 Set smartspace to 30% visibility on workspace edit for home gardening
Here we set the smartspace to have 30% visibility to follow the guidelines set by https://docs.google.com/presentation/d/1FOmmCdmGmSMR77_901IOMbvbPVxPmjaAdxZjy-D9tw0/edit#slide=id.g159289e55db_0_229

Bug: 251259222
Test: Enter drag mode in workspace with SHOW_HOME_GARDENING flag on to see the changes
Change-Id: Ia2ef4f1a49549fef9f8fbea7c007db8b81972f71
2022-10-21 13:00:58 -07:00
Federico Baron
41235d529b Merge changes I03636e28,I6cf6d52e into tm-qpr-dev
* changes:
  Fix page indicator dots height in workspace
  Change delightful pagination flag and use it for workspace
2022-10-19 19:33:18 +00:00
Federico Baron
1028a726ef Get rid of spring loaded mode for home gardening design
For the new home gardening mode, we plan on not having a spring loaded mode where the overlay shrinks, so when we have the flag for home gardening on, we won't be having the workspace have the green overlay and the icons shrink

Bug: 251259222
Test: Hold on an icon in workspace to enter edit workspace mode, notice how we no longer shrink the workspace
Change-Id: Ibf1c38eecc117a838eca20a860d47c355955b513
2022-10-18 13:49:37 -07: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
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
Federico Baron
471e2178f8 Fix page indicator dots height in workspace
In workspace, the page indicator dots end up in the bottom because we were missing a setInsets method (WorkspacePageInidcator.java uses this method to set the page indicator to the right height).

Bug: 249773534
Test: manual
Change-Id: I03636e28244f329b249453a6d22eb0ec7d85c45f
2022-10-05 09:31:55 -07:00
Sunny Goyal
211496e3d8 Merge "Removing some obsolete features" into tm-qpr-dev 2022-08-22 20:27:45 +00:00
Thales Lima
3906192135 Merge "Show resize handle on cancel widget drop" into tm-qpr-dev 2022-08-16 15:02:54 +00:00
Sihua Ma
2d675e8ab0 Merge "Resize preview for correct clipping" into tm-qpr-dev 2022-08-16 00:15:06 +00:00
Sihua Ma
e04aa207f2 Resize preview for correct clipping
Before, the remote view for the widget in launcher is reused to generate a new preview. However, measuring the view without changing the scale would cause strange clippings. This CL sets the scale of the widget views by manually computing the size ratio.

Change ag/19572297 is necessary before a complete clean-up.

Test: Create a weather widget on first screen -> go to Wallpaper & style -> App grid -> tap on a different grid and verify that the clipping is correct
Fix: 228328759
Change-Id: I8242d3bcfcf30ec924552c1320e22f8a3592f1c1
2022-08-09 23:57:41 +00:00
Andras Kloczl
eb6a154230 Fix widget jump bug when moved to invalid place
When dropTargetLayout is null we don't need to
animate the widget to the closest location but
move it back to its original position.
Test: manual
Bug: 236135424

Change-Id: I50a793732cd9656605fdc9908f71ff0efa7e69e9
2022-08-09 10:53:33 +02:00
Thales Lima
84fa75cc7d Show resize handle on cancel widget drop
Fix: 233834133
Test: manual on handheld and large screens, until we have create a way to resize widgets in TAPL b/241385885

Change-Id: I427dfaadd219d33a5371c3ae92c4e2311d3d3c6a
2022-08-05 10:30:37 +00:00
TreeHugger Robot
89b8f65277 Merge "Account for span greater than 1 in getReorderRadius" into tm-qpr-dev 2022-08-03 14:12:45 +00:00
Sunny Goyal
c5c7da9a8b Removing some obsolete features
PROMISE_APPS_NEW_INSTALLS = true
ENABLE_QUICKSTEP_WIDGET_APP_START = true
FOLDER_NAME_SUGGEST = true
ENABLE_PREDICTION_DISMISS = true
HOTSEAT_MIGRATE_TO_FOLDER = false
ENABLE_DEEP_SHORTCUT_ICON_CACHE = true
ENABLE_THEMED_ICONS = true
ENABLE_ALL_APPS_EDU = true
EXPANDED_SMARTSPACE = false

Bug: 241141733
Test: Presubmit
Change-Id: I72c0c20ab7e214994dc3c3665c90e85d45991a7a
2022-08-02 13:38:38 -07:00
Sebastian Franco
6e1024e161 Account for span greater than 1 in getReorderRadius
Fix: 239963678
Test: Making sure the reorder preview is being drawn when moving a widget
Test: atest ReorderWidgets
Change-Id: Id32919821ac9177b3428261354d361c52b8f9e2d
2022-07-29 13:47:33 -07:00
Schneider Victor-tulias
1dbffe0af7 Remove unused logs
Fixes: 240173459
Test: Started launcher
Change-Id: I853d9a50a0c34a7fdda87ea20d46a9f7ac7542e3
2022-07-29 13:06:24 -07:00
Shikha Malhotra
bc9b08fdd1 [Cherry pick merge conflict] Updating visibility of some members for easier extensibility
This change is causing a merge conflict with ag/19441591. Hopefully only a cherrypick is needed.

Bug: b/218186980
Test: Manual Testing that Launcher3 compiles and works
Change-Id: Id85486ef763ce9a04b83fef44542b2eb3e0e599d
(cherry picked from commit c487e1b4c5)
2022-07-27 20:33:29 +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
Abhilasha Chahal
cb32935281 Allow overriding DragController and drag use cases
Test: Manually verified Launcher3 works fine
Bug: 233864888
Change-Id: Ifb2fe19c0a2b332862b36b1ac0100e0f5301a5a6
2022-06-29 17:29:47 +00:00
Sebastian Franco
930531f669 Make Talkback anounce which page is the icon being move on.
Adding a third argument for the talkback string.

Fix: 230593493
Test: Move an item using Talkback and it should mention the row,
column and page where you can drop the item.

Change-Id: Id3d4435e9ef3348278643e6e2a1cd1e8bf5157b7
2022-06-22 17:17:38 -07:00
Jon Miranda
46ecc0ca08 Pause expensive view updates before setting hw/sw layers.
Prevents widgets from updating mid animation.
Also pauses view updates during app close animation.

Bug: 220939231
Bug: 230617085
Bug: 226171754
Test: manual

Change-Id: I0138d57e6a7b2c22fd9a029e971b3e27c7e9f22e
2022-06-02 12:21:01 -07:00
Pinyao Ting
6a41d56b50 Log the reason why a WorkspaceItemInfo was removed
In the past we've seen a WorkspaceItem disappeared from the workspace
but wasn't able to determine why it was removed. This CL includes the
reason why it was removed in the error log, which hopefully would help
us debugging similar issues in the future.

Bug: 231239260
Test: make
Change-Id: Iba3d57568c9b3e011a6b65b26f0d4170d42fe1a5
2022-05-16 20:17:47 +00:00
Sunny Goyal
f0ff70a2a5 Adding support for easily extending Launcher DragAndDrop support
Bug: 232165524
Test: Verified locally
Change-Id: I3b4f37bc9914de55330662edd678e6fdd0eafece
2022-05-11 21:34:08 +00:00
Sunny Goyal
f76524151d Merge "Replacing ItemInfoMatcher with predicate" into tm-dev 2022-05-03 20:04:55 +00: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
Alex Chau
f39cc126bf Tune AllApps dismiss animation
- Avoid overriding interpolator in AllAppsTransitionController.setStateWithAnimation as it's no longer needed and it'll wrongly override interpolator for ANIM_ALL_APPS_FADE
- Override ANIM_ALL_APPS_FADE to FINAL_FRAME in QuickstepAtomicAnimationFactory for tap deadzone to dismiss animation, also added EMPHASIZED_ACCELERATE for the dismiss animation
- Tuned dismiss animation across form factors to 300ms

Fix: 220336617
Test: manual
Change-Id: I4b3e827b503dcb1dd39f0bd99d4c1dd5ffdba0f3
2022-04-29 20:31:26 +01:00
Andras Kloczl
0056e95d8e Change home dragging logic for dead zones
- If a dragged item is not over a valid drop target
then we don't highlight anything and on drop we move
it back to its original position.
- Instead of checking if the dragged item is over the
hotseat view, now we check if the item is over the hotseat
shortcuts.
- Smartspace is a dead zone

Test: drag items from different workspaces, allapps, widget
  picker etc. to all parts of the screen and verify which
  view is targeted and where the item gets dropped.
  Check on phone/foldable/tablet.
Bug: 228201267
Change-Id: I18de576ea300d58ae645e511b238e0b946b5595a
2022-04-26 16:28:11 +01:00
Sihua Ma
da8759ae29 Showing alert dialog when shortcut version higher than the App
Creating an AlertDialog when the disabled reason of the shortcut is DISABLED_REASON_VERSION_LOWER, which happens when the backed-up shortcut was created from an application that has a version higher than the one installed on the device. The AlertDialog will direct the user to the play store and update the application.

Test: Manual
Fix: 224796975
Change-Id: I0125fada60b48176775de6782ba03ee6790904aa
2022-04-14 01:34:44 -07:00