1026 Commits

Author SHA1 Message Date
Pranav
8e9904e542 workspace: Fix an npe
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
	at com.android.launcher3.Workspace.removeAllWorkspaceScreens(Workspace.java:608)
	at com.android.launcher3.Launcher.startBinding(Launcher.java:2203)
	at com.android.launcher3.model.BaseLoaderResults$WorkspaceBinder.lambda$bind$0(BaseLoaderResults.java:200)
	at com.android.launcher3.model.BaseLoaderResults$WorkspaceBinder$$ExternalSyntheticLambda7.execute(Unknown Source:0)
	at com.android.launcher3.model.BaseLoaderResults$WorkspaceBinder.lambda$executeCallbacksTask$9$com-android-launcher3-model-BaseLoaderResults$WorkspaceBinder(BaseLoaderResults.java:260)
	at com.android.launcher3.model.BaseLoaderResults$WorkspaceBinder$$ExternalSyntheticLambda9.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7871)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:550)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-05-16 21:37:28 +05:30
Suphon Thanakornpakapong
784fa2f9d0 Fix smartspace long press 2022-05-14 16:28:30 +07:00
Suphon Thanakornpakapong
6dab0ef351 Add shortcut to smartspace preference 2022-05-14 15:23:02 +07:00
Suphon Thanakornpakapong
659639842c Add smartspace to widgets picker 2022-05-13 16:33:13 +07:00
Suphon Thanakornpakapong
11e1a2fdc8 Merge remote-tracking branch 'aosp/android12L-release' into 12.1-dev 2022-05-08 20:29:17 +07:00
Patryk
6c67991805 Remove “pref_allowEmptyPages” 2022-03-13 15:54:46 +01:00
Peter Njeim
82d6c26b84 Add WallpaperManager check to support WSA 2022-01-01 10:48:46 +01:00
Jon Miranda
52ee4ec4aa Merge "Play return to icon animation if user swipes back to All Apps." into sc-v2-dev 2021-12-06 18:17:52 +00:00
Jon Miranda
c4a99bff04 Play return to icon animation if user swipes back to All Apps.
Bug: 205187702
Test: open app in all apps, swipe back to go back to all apps
Change-Id: I9e79c8365fdf667321343aaac2f8d77cb60a316a
2021-11-23 11:27:42 -08:00
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
Suphon Thanakornpakapong
8312e91889 Use stretch overscroll in workspace 2021-10-11 23:24:05 +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
Suphon Thanakornpakapong
cc2bd15873 Merge remote-tracking branch 'aosp/android12-release' into 12-dev 2021-10-05 14:13:08 +07: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