Commit Graph

1155 Commits

Author SHA1 Message Date
Tony Wickham
49da26f636 Merge changes I36871463,I691a5cbb,I62105c1c into sc-v2-dev
* changes:
  Update reorder and folder creation radii
  Fix misaligned folder creation drag over target
  Update CellLayout.DEBUG_VISUALIZE_OCCUPIED to include drag over targets
2021-11-17 22:08:28 +00:00
Andras Kloczl
953eb8041e Fix LauncherProvider newScreenId issue
Remove maxScreenId from LauncherProvider and whenever we need
a new screenId, query the database to calculate a new screenId.
Also converted and refactored AddWorkspaceItemsTaskTest
and added some extra test cases.

Test: manual & AddWorkspaceItemsTaskTest.kt
Bug: 199160559
Change-Id: I185f6823fed171d778af0130497f5ffaf89c0a70
2021-11-12 19:56:07 +00:00
Tony Wickham
1278490ac0 Update reorder and folder creation radii
- Before, dragging anywhere in the cell (including space between cells) would trigger a reorder. Now, we compute the radius to the closest cell edge
- For creating folders on icons, we split the difference between the reorder circle (above) and the icon size

Test: enable DEBUG_VISUALIZE_OCCUPIED and manually drag to ensure works as described above
Bug: 204406063
Change-Id: I368714634ed42a930fd16849f2bde1589df1aa63
2021-11-08 12:04:30 -08:00
Tony Wickham
3cfa5edc93 Fix misaligned folder creation drag over target
Previously, the folder creation distance was based on the center of the cell, rather than the *visual* center, i.e. around the icon. Updated to use existing getWorkspaceVisualDragBounds() to handle this.

Test: with DEBUG_VISUALIZE_OCCUPIED=true, ensure green circles are centered around the app icons; manually drag and drop to check the drawn regions are correct
Bug: 204406063
Change-Id: I691a5cbbfc18c88436b88b7bda42f7920b9a5750
2021-11-04 13:40:05 -07:00
Tony Wickham
0ac045fe23 Update CellLayout.DEBUG_VISUALIZE_OCCUPIED to include drag over targets
Instead of just drawing the occupied cells in red, now we draw the occupied cells based on drag over regions:
- Dragging over the red regions will reorder the cell
- Dragging over the green regions will create/add to a folder

Test: visual with internal flag on
Bug: 204406063
Change-Id: I62105c1c1a1101b6cd6f9fd222980d03ba6d8b84
2021-11-04 13:27:56 -07:00
Steven Ng
91b46d1ba3 Update all home screen widgets size upon workspace inset change
Test: Add a clock widget to the home screen. Then, change the navigation
      gesture. Go to home screen to confirm the clock widget is rendered
      as expected in the portrait. Then, rotate the device to landscape.
      Confirmed the clock widget is rendered correctly in the landscape.
Fix: 202837404
Change-Id: I93b70c53f10c8150131b183defc8baf01e5924a8
2021-11-04 12:00:03 +00:00
Alex Chau
920be89b26 Clean up IllegalStateException for page pairing
Fix: 198820019
Test: manual
Change-Id: Ic691f781b20d664c57a26370aae479ab68508303
2021-10-25 15:20:16 +01:00
Schneider Victor-tulias
16e04e29d2 Generalize the icon popup menu types.
Generalized popup menu types and logic to allow wider uses outside of launcher.

Bug: 198438631
Test: long pressed launcher icons and pressed menu options
Change-Id: Iadcbb1796496c0061dcee362784e426ff55dc94a
2021-10-19 16:06:16 -07:00
Thales Lima
9a6b20f0cb Merge "launcher: create more space options" into sc-v2-dev 2021-10-05 15:38:57 +00:00
Thales Lima
78d00adcbe launcher: create more space options
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
2021-10-05 12:26:05 +01:00
sfufa@google.com
ca76de0e6e Support drag/drop on search results
Bug: 199341710
Test: manual
Change-Id: I9879c2a3769d4f930ab0289d2f26e4757971549d
2021-10-04 13:14:12 -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
6b8a139581 Merge "Remove nonOverlappingTaskarInsets" into sc-v2-dev 2021-09-22 22:44:45 +00:00
Tony Wickham
21970ccd29 Remove nonOverlappingTaskarInsets
- Override our insets in LauncherRootView to explicitly only care about nav bar size, ignoring any insets due to taskbar.
- Previously we used nonOverlappingTaskbarInsets to belatedly subtract from measurements in e.g. DeviceProfile, but now we can revert most of those calculations since we effectively subtract taskbar insets at the root.

Test: visual in different orientations and navigation modes, and testPressHomeOnAllAppsContextMenu to ensure REQUEST_WINDOW_INSETS still works for automated tests
Fixes: 200607741
Change-Id: I8de5a268c686a1354b4beaa30e101bab6bed5af9
2021-09-21 13:52:43 -07:00
Steven Ng
3bbebe2439 Merge "Add an animation for invalid widget resizing in 2 panel UI" into sc-v2-dev 2021-09-21 09:27:44 +00:00
Steven Ng
4b346108d1 Add an animation for invalid widget resizing in 2 panel UI
Test: manual
Fix: 197509872
Change-Id: Ibcfae107e7f4b3bfbc562d4a6436f4b9237db122
2021-09-20 15:33:23 +01:00
Thales Lima
d1df5fcaac launcher: use scalable grid in 4x4
Many changes are required to make scalable displays work correctly on
foldables. This first one is making sure that the correct number of
columns is used when calculating the used width for scalable grid. The
spaces around the workspace are not final yet.

Bug: 191879424
Test: manual
Change-Id: Idc41ed004580f1f86d8f9595d005abc72301b1e3
2021-09-17 10:43:42 +01:00
TreeHugger Robot
b94401646d Merge "Fix wrong screenId when committing emptyScreens" into sc-v2-dev 2021-09-10 15:36:22 +00: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
Alex Chau
1d5929dd82 Fix wrong screenId when committing emptyScreens
- Need to increment newScreenId whenever the screen is already bound
- Also cleaned up placeholder on w1 as we now have page pairing logic

Bug: 199160559
Bug: 175939730
Fix: 199131780
Test: drag and drop after clear data
Change-Id: Ic42f3bddfa6cf11b8b726d6181ed2477defde19d
2021-09-10 14:36:36 +01: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
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
Andras Kloczl
d888e77145 Fix crash when hotseat icon is dragged onto Workspace
Test: manual
Bug: 198820019
Change-Id: I53bb858feb7aad45472803b133ef3d026dd9f319
2021-09-06 16:43:01 +01:00
Alex Chau
62f129b878 Fix getPagesToBindSynchronously returning wrong page pairs
- Use WorkSpace.getPagePair instead for accurate value

Bug: 191657065
Test: manual
Change-Id: I584f1705fb5ed2f0d2bd776eb6cf4f60c69238ac
2021-09-06 10:58:48 +01:00
András Klöczl
4926bf706a Merge "Add two extra empty pages on two panel launcher home" into sc-v2-dev 2021-09-05 21:05:53 +00:00
Andras Kloczl
408a54f2e7 Add two extra empty pages on two panel launcher home
Add a new screen ID for the second extra empty page
and add that new screen as well when the existing
extra empty page is added so that users can put items
on both sides of Workspace.

Test: manual
Bug: 196376162
Change-Id: I0b4f2e818407a10d8a7c032788a7bd7a61267779
2021-09-05 22:03:07 +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
András Klöczl
701c76013c Merge "Two panel home empty page removing logic change" into sc-v2-dev 2021-08-26 11:09:05 +00:00
Andras Kloczl
8c574de97f Two panel home empty page removing logic change
- Don't remove a single page if it's empty, only if both pages are empty.
- Add back empty pages after they were removed while the phone
  was on single panel home.
- On two panel home don't add new workspace items onto the second screen

Test: manual
Bug: 196376162
Change-Id: I4c54ffa3b359a236deb3ab67adb54111e77ec896
2021-08-26 12:06:50 +01:00
Thales Lima
653ae0a524 Merge "workspace: get the correct page when setting paddings" into sc-v2-dev 2021-08-25 11:54:13 +00:00
Thales Lima
41f33c3cfd workspace: get the correct page when setting paddings
When adding a new page to the workspace, mWorkspaceScreens doesn't
necessarily keeps the order. We should use the mScreenOrder field to get
 the correct index of pages.

Fixes: 197198491
Test: drag an app from first page and paddings should be correct
Change-Id: I4f79c164391348b53b71a87d5d49cfc4d3d35e5a
2021-08-25 11:16:13 +01:00
TreeHugger Robot
46db057249 Merge "Fix NPE when converting final screen to empty screen." into sc-qpr1-dev am: 70dd01be85
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15583988

Change-Id: Ie6d11b74141ff777b10f05919b9a61f7af809900
2021-08-19 15:43:06 +00:00
Jon Miranda
26de7be984 Fix NPE when converting final screen to empty screen.
Bug: 194553613
Test: manual
Change-Id: Id29b8574964688f6f6aa96dd5b1b8a4d8b9110c0
2021-08-16 16:47:11 +00: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
Yogisha Dixit
104d09f143 Add logging when item not added due to insufficient space.
Bug: 194061824
Test: manual
Change-Id: Ib6f6b9ab4a8e1b59b1dbd1c7c137962efa3e880e
2021-08-10 13:57:47 +01:00
Steven Ng
cea65b75d8 Fix wallpaper parallax calculation for large screen devices
Test: manual
Bug: 193403434
Change-Id: Ifaed71f8c3645b012def02a9ea36fc3fb29bac00
2021-08-05 16:05:50 +01:00
TreeHugger Robot
1e46696161 Merge "Fix Workspace item move issues when using Talkback" into sc-v2-dev 2021-08-04 10:48:22 +00:00
Andras Kloczl
e32e8641d6 Fix Workspace item move issues when using Talkback
- fix the crash when an item was moved onto the right panel
- fix the issue that prevented the user from moving an item from the left panel

Test: manual
Bug: 194903736
Change-Id: Ib41f5d6d08e8815a52631ef952d32dcf899455e2
2021-08-04 11:04:19 +02:00
Steven Ng
61cfa57ad8 Correct cell layout spacing in n-panels UI
Test: manual
Fix: 184966000
Change-Id: I6940413c24f41df0b1ffcfd4bec4b0c5c3497b6d
2021-08-03 16:40:41 +01:00
Steven Ng
2a5c594855 Fix cell size calculation in large screen devices
Test: Digital clock widget is no longer cropped.
Bug: 184966000, 194784402
Change-Id: I26c406da1e10232019f34620a4d2bc0dbafcbb31
2021-07-30 11:14:11 +01:00
Sunny Goyal
69a8eecdc9 Simplifying color extraction registration logic
> Calulating correct location irrespective of transient
  state (scale/translation)
> Removing extraction pause/resume logic
> Simplifying location calculation and registration (only use one location instead of a list)

Bug: 194732483
Test: Manual
Change-Id: I255d83761bff5e09c9fb0a5e398d0be0c1d0956f
2021-07-28 15:43:13 -07:00
Sunny Goyal
12e3f1f2f7 Removing UI dependency from LauncherModel in case of 2-panel layout
Bug: 175939730
Bug: 192431856
Bug: 185515153
Test: Manual
Change-Id: I8baa1cf9e5a8a04d5b8bc38c1f4b0755265cd8a9
2021-07-22 10:34:25 -07: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
Sunny Goyal
711c596c86 Binding Taskbar directly from Launcher model
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle

Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
2021-07-15 12:43:11 -07:00
Pierre Barbier de Reuille
41f78f1e13 resolve merge conflicts of 25e37a85ae to sc-v2-dev
Change-Id: I78062d68d051a5f3c369214929f569b17c5a3471
Fix: 192532604
Bug: 192354264
Test: Manual
Merged-In: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
2021-07-01 09:47:10 +00:00
Pierre Barbier de Reuille
43e17301c4 Correct color extraction on App Widget drop.
Disable color extraction on drop until the workspace is back to its
normal size, then re-enable it and force re-coloring. This needs to
happen if the drop is on the workspace, but also if the drop is on the
secondary target.

Fix: 192354264
Test: Manual, see bug for details.
Change-Id: I79203f68843d59384503aa76f4813d886e98afa3
Merged-In: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
2021-06-30 18:50:41 +01:00
Steven Ng
f5555fcb8e Merge "Add null check before detach content view from dragView at onDropComplete" into sc-dev am: 5b786ca88d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15042822

Change-Id: Idc12dd2613200ce6e9901856b14c4ce0c5946fb6
2021-06-23 21:17:48 +00:00
Steven Ng
92335ed7bd Add null check before detach content view from dragView at onDropComplete
Test: Drop a conversation widget on a configuration button. No crash
      is observed.
Fix: 191762933
Change-Id: I483c6f4dbc9fc6c096383682284a4c854707f583
2021-06-22 23:26:05 +01:00
Sunny Goyal
0c299cb324 Merge "Simplifying the drop animation code" into sc-v2-dev 2021-06-16 23:18:16 +00:00
TreeHugger Robot
c51564bb7a Merge "Reattach LauncherAppWidgetHostView to its parent after canceling drag" into sc-dev am: 4176cb33bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14970490

Change-Id: I5a92dc73ce2dcde24ea5fd7d826211e9d35a717e
2021-06-16 22:39:09 +00:00