Commit Graph

22 Commits

Author SHA1 Message Date
Sihua Ma
dfd8bfc7e0 Added functions to pass launcher widget span info to preview
To calculate the widget scales correctly for the launcher preview in different grids, the span info of the widgets in the launcher is necessary. Querying the launcher widget info in the database and passing it to the preview render.

Test: Verified that no exceptions were happening when changing preview grid layouts
Bug: 228328759
Change-Id: I681d21b176c8fe5208431a79009d9ba8279cda6a
2022-07-14 20:17:19 +00:00
kholoud mohamed
9b38947b32 Fix crash when loading string cache
Crash was caused by a null context in ModelDelegate

Fixes: 218305827
Test: manual
Change-Id: I1b046e24427dbdc6752ac100f488c428838ac31f
2022-02-21 11:29:24 +00:00
Brian Isganitis
1094b503f5 Support dark theme in wallpaper launcher preview.
Test: Search bar in wallpaper preview follows dark theme without themed
icons enabled.
Fix: 197475508

Change-Id: Ib71356fad3510348c1408c886c4796bc16a59642
2021-08-27 14:23:17 -04: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
TreeHugger Robot
04c4f94223 Merge "Fixing ModelPreload cancelling existing load" into sc-qpr1-dev am: 8782ad4f99
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15524186

Change-Id: Ib89cd2bbe854242c87f52d2edc384ae864af01c2
2021-08-18 05:21:30 +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
Sunny Goyal
57e0866fdd Fixing ModelPreload cancelling existing load
When a model preload call was made while the loader task is running
(eg: on enabling/disabling icon theme, Launcher reloads and then
launcher preview start a model-preload), it would cancel the original
loader and then start a new loader with empty callbacks. So the
model indeed get loaded, but the original callbacks never got notified
of it.

> Instead we only start preload if an existing task is not running.
> Also when preloading, we use existing callbacks, instead of using
  empty callbacks

Bug: 193851085
Bug: 195155924
Test: Verified repro steps
Change-Id: I0a96310be8489756f364aa2a12e4345e1418733d
2021-08-12 21:33:33 +00:00
Sunny Goyal
278939fdf3 Removing GridMigrationTask-v1 since it has been disabled for a while
Also removing some data migration support

Bug: 194937047
Test: Presubmit
Change-Id: I392a5f6e49ec170f63056a7664de47229896f390
2021-07-28 15:55:43 -07:00
Andras Kloczl
454ea214ad Fix launcher preview for two panel follow up
Fixing a possible context issue that was suggested
on the previous CL (ag/15079450) after it got submitted.

Bug: 185508060
Test: manually check launcher preview in wallpaper app
Change-Id: Ia653b833e4c1b911c7d7cac38c35ec2d12ab3a29
2021-07-27 00:27:32 +02: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
Brian Isganitis
b684c1b59b Revert "Merge "Revert "Use wallpaper colors for widgets in wallpaper change preview"" into sc-dev"
This reverts commit 7de95d6767, reversing
changes made to 0a70a5a690.

Lints have been added to fix errorprone.

Test: Widgets should adapt to wallpaper colors in launcher preview.
Bug: 192205054
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586
Change-Id: I6866f8521ed427d096f27da0a92d8b40e1099187
2021-07-19 21:03:26 -04:00
Jonathan Miranda
f5fee1a7d3 Revert "Use wallpaper colors for widgets in wallpaper change preview"
Revert "Implement generateColorsOverride from LocalColorExtractor"

Revert submission 15331418-colorcp

Reason for revert: Broke the build
Reverted Changes:
Ife80b07f9:Use wallpaper colors for widgets in wallpaper chan...
I1371eb787:Implement generateColorsOverride from LocalColorEx...

Bug: 194138049

// Using original change's merged-in tag to avoid clashing
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586

Change-Id: I3835dfb8efe745dc0a654712a5b1f68c4946f446
2021-07-20 00:44:42 +00:00
Brian Isganitis
74e6ced362 Use wallpaper colors for widgets in wallpaper change preview
Test: Widgets should adapt to wallpaper colors in launcher preview.
Bug: 192205054
Merged-In: I3fb76b6036cb909771b789eac15742df78c2c742
Merged-In: I4da9ad1cc88be251f97e86b6c8c9b346ed20f586
Change-Id: Ife80b07f99da913d65bff96fba2ccd76b0a2ed48
2021-07-19 16:58:20 -04:00
Andras Kloczl
ac3f08558c Fix launcher preview for two panel home
Test: manual
Bug: 185508060
Gif: http://shortn/_oOgKLjg5QC
Change-Id: I216b3761b3bd15c7069b92aa4a1bff8ad655b767
2021-07-13 23:13:17 +02:00
Brian Isganitis
4a76315805 Use wallpaper colors for widgets in wallpaper change preview
Test: Widgets should adapt to new wallpaper colors in launcher preview.
Bug: 191499358
Change-Id: I3fb76b6036cb909771b789eac15742df78c2c742
2021-06-21 19:18:17 -04:00
Chihhang Chuang
ccb71776c6 Apply the current system window insets to launcher preview
For wallpaper picker, the position of app icon on the wallpaper preview would match to the launcher after applying the wallpaper.

Wallpaper picker: https://screenshot.googleplex.com/JZazpgZLgzacZMZ.png
Launcher: https://screenshot.googleplex.com/9uTTQwdmcnFZ7Vi.png
Gesture mode: https://screenshot.googleplex.com/3YaKbBerYgtHBFb.png
3-button mode: https://screenshot.googleplex.com/7sA5nE3GmbuKf62.png

Fixes: 188539072
Test: Manually
Change-Id: I553000e6ae646207eb94fa33e97d00a3990043c8
2021-05-21 14:41:37 +08:00
Sunny Goyal
df4241ca4e Fixing Launcher preview leaking surface and memory
> Closing existing preview if a new request comes for same host token
> Closing in-memory icon db when closing preview
> Removing unnecessary wait blocks on UI thread and rendering
  view asynchronously
> Fixing preview loading failing on LauncherAppState access

Bug: 186712316
Bug: 187140897
Test: Manual
Change-Id: I045930b007e5dc015320224a197eee20a8354d17
2021-05-20 21:37:28 +00:00
Sunny Goyal
9ab43772ab Adding support for using themed icons on workspace
Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
2021-05-03 20:00:38 -07:00
Tracy Zhou
6b79a3767d Do preview grid migration in a worker thread
Also remove USE_SURFACE_VIEW_FOR_PREVIEW flag

Fixes: 159755324
Test: manual
Change-Id: I6517c34911e217a69063226b01e4583194902f9c
(cherry picked from commit 633a4bdf57)
2020-06-25 21:05:04 +00:00
Tracy Zhou
7087a7bd91 Don't continue rendering preview screen when binder is dead
Fixes: 155365052
Test: manually quick switches between different grid options
Change-Id: I31dc14b0a50b5e3a5c81272b693303034fcf8b40
2020-05-13 14:06:05 -07:00
Tracy Zhou
0d880c876b Fade in grid preview
Fixes: 156406762
Test: https://drive.google.com/open?id=1JshUMjd1ASjHcAhnAiG3PEC-6wCRY7EE
Change-Id: I6a99650796fe64a6c11ee9fad6904b14373c6363
2020-05-12 14:43:44 -07:00
Tracy Zhou
bb353d3741 Switch to public API for surface view when rendering preview
Bug: 152003916
Test: Manual
Change-Id: I539ed2876d869366fa7635f4467d19e8488b7a1a
2020-04-06 14:39:52 -07:00