Commit Graph

155 Commits

Author SHA1 Message Date
Sunny Goyal 741107cc53 Merge "Updating test build rules" into sc-v2-dev 2021-08-18 19:23:33 +00:00
Sunny Goyal 4af8cf9269 Updating test build rules
> Moving definition to bp files
> Adding mokito-inline to allow mocking final classes
> Moving src_common to src to avoid unnecessary code split

Bug: 196825541
Test: Presubmit
Change-Id: Ib6879cda6aee74f5b9050a16eb6ca94ed3b7e28c
2021-08-18 10:22:52 -07:00
Sunny Goyal ed2a55f413 Removing widget preview caching
> All previews are generated on demand when the corresponding
  header expands
> Using ItemAnimator to animate layout changes when preview loads

Bug: 196238313
Test: Manual
Change-Id: I0cb859c8443c2c536399e4063f58baecfc7416ad
2021-08-17 17:50:30 -07:00
Sunny Goyal 77acf12905 Fixing header jump
Linking header position to an empty entry in the recyclerView,
instead of calculating the vertical scroll position. This
allows the header to be in sync with the recyclerView scroll and
item animations

Other simplifications:
> Moving top collapse handle out of header view (it doesn't scroll)
> Removing background clipping logic from full-sheet
> Moving tab bar inside the header view

Bug: 196464142
Test: Verified on device
Change-Id: Iae5a0ae9af7ce258e1b391b8e85c5c270fe56197
2021-08-16 09:45:14 -07:00
Sunny Goyal 68031ca3f9 Storing form factor as part of backup and disabling restore if form-factor is different
Bug: 195301649
Test: Manual
Change-Id: I9a9c4bc9246f40af2209cb914b3966319bc78bff
2021-08-04 09:51:04 -07: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
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
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
Bryan Bonnet 37f1fbf7ab Merge "Update CachingWidgetPreviewLoaderTest members to be non-static. These classes are stubbed by roboelectric so they cannot be static" into sc-dev am: 8fc2d80a32
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15226443

Change-Id: I583f47607a042c4206025517f2dcbf31e1182d0f
2021-07-08 15:36:38 +00:00
Bryan Bonnet 3341a710d9 Update CachingWidgetPreviewLoaderTest members to be non-static. These classes are stubbed by roboelectric so they cannot be static
Bug: 183335046
Change-Id: Iafb52f87e8e3ece399f4e83c056b2a0dac160d6c
2021-07-07 23:55:42 +00:00
Alina Zaidi b06e92fc83 Merge "Compare maxSpanSize for WidgetsListContentEntries when updating visible entries in widget picker." into sc-dev am: 50401e31bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15052492

Change-Id: Id36a1ed53de7fc45cb8f7f9fc2f295f23ca3643d
2021-06-26 18:13:24 +00:00
Alina Zaidi 0b320545f8 Compare maxSpanSize for WidgetsListContentEntries when updating visible
entries in widget picker.

This is so that widgets are rearranged according to maxSpanSize in
widget table

Bug: 191336852
Test: Manually rotated widget picker with one of the headers expanded
and checked that widgets in widget table adjust according to screen's
horizontal size.

Change-Id: I2406ca9eccd18f4bb32b396acaa188c37f0059ee
2021-06-25 13:46:03 +01:00
Steven Ng 1579854153 Merge "Use default spans as min spans if the min spans > default spans" into sc-dev am: fa9f70be03
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15081332

Change-Id: I64311aa17528c8c968a8cd2f032992c6e00225d7
2021-06-23 21:17:55 +00:00
Steven Ng 0571a370d1 Use default spans as min spans if the min spans > default spans
This is to match the behavior described in
AppWidgetProviderInfo#minResizeWidth/Height documentation.

Test: run LauncherAppWidgetProviderInfoTest
Bug: 191223844
Change-Id: I37c0c8bf5e4588919e5b30fab6d2fde7236e114b
2021-06-23 17:11:05 +01:00
Sunny Goyal 49537a8942 Merge "Simplifying Launcher binding callbacks" into sc-v2-dev 2021-06-22 03:42:28 +00:00
Stevie Kideckel 50820e1fb5 Merge "Load widget preview images before adding the rows to the adapter" into sc-dev am: dd19a24769
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14965044

Change-Id: If6b6e437f558922aa0f047c4ce01bb424a0045ae
2021-06-18 22:44:39 +00:00
Stevie Kideckel dd19a24769 Merge "Load widget preview images before adding the rows to the adapter" into sc-dev 2021-06-18 22:37:32 +00:00
Stevie Kideckel a093523299 Load widget preview images before adding the rows to the adapter
This allows for smooth animations as the items will have their full
height resolved

Bug: 190892517
Test: verified locally
Test: CachingWidgetPreviewLoaderTest
Change-Id: I86afc6951a4cc82ae45e63795791d259a3bb3cda
2021-06-18 19:18:29 +00:00
Sunny Goyal 4a48a988c8 Simplifying Launcher binding callbacks
> Making all methods as default
> Removing obsolete logic around synchronous binding
> Removing some UI dependencies from bind callbacks

Bug: 187353581
Test: Manual
Change-Id: I0d2bbb060af2cab7c64541d7695055629dfaf0b8
2021-06-17 15:21:01 -07:00
TreeHugger Robot 853186578d Merge "Prevents a ConcurrentModificationException in Widget" into sc-dev am: 3a37543fb9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15001812

Change-Id: I6aa3f859df6a706716081d4258200eafeafcada3
2021-06-17 01:09:54 +00:00
Pinyao Ting 9cd63c97ce Prevents a ConcurrentModificationException in Widget
InvariantDeviceProfile.supportedProfiles can be modified in respect to
configuration changes. This CL ensures the list was cloned before access
to prevent ConcurrentModificationException

Bug: 191231591
Test: manual
Change-Id: I123458dcfe99af4babca2cf73733e3d2af0fad3c
2021-06-16 21:02:48 +00:00
Stevie Kideckel 857820793f Merge "Use drawable states for list positions instead of swapping drawables" into sc-dev am: 358411a96a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14966492

Change-Id: Iab3dc8912f976159a2536a631594535b39ade45f
2021-06-16 09:50:25 +00:00
Stevie Kideckel 803927bdae Use drawable states for list positions instead of swapping drawables
Replacing drawables interrupts touch feedback of ripples. Implementing
custom state lists allows altering the corner radius without cutting off
ripples and also means we reduce unnecessary object creation.

Fix: 190467676
Test: locally
Change-Id: I10eec042aae57d278f8254327d42df945767c7ac
2021-06-15 16:32:36 +00:00
Steven Ng f8eca2008d Merge "Use grid size as the upper bound for widgets' default size in initSpans" into sc-dev am: eb1617521c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14776609

Change-Id: Ic74b543e4fb94ab377472cb5d8e25fe449818081
2021-06-08 15:06:03 +00:00
Steven Ng 1d47d8c705 Use grid size as the upper bound for widgets' default size in initSpans
Test: In Pixel 4, drag a monthly view Google calendar widget to a new
      home page from the full widgets picker. The widget outline is
      correctly shown.
Bug: 189060113
Change-Id: I33113b29cc8923098de95f1d5eb14c2b02429de1
2021-06-08 14:15:50 +01:00
Brian Isganitis 5980354d54 Show toolbar back button on subsettings pages am: 6afcfd7cbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14741513

Change-Id: I5521e29757bb7bf7d0fb8d0774ae84776abb4ba7
2021-06-03 22:39:49 +00:00
Brian Isganitis 6afcfd7cbd Show toolbar back button on subsettings pages
Test: Back button displayed and functional on subsettings
Bug: 187732263
Change-Id: I6a3679de3a00480f5a0861f966d178be25f001d4
2021-06-03 17:04:33 -04:00
Steven Ng 02045feb20 Merge "Don't dismiss keyboard after clicking X button on the widgets search bar" into sc-dev am: 755723403b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14748544

Change-Id: Id13572638904399f37f24ae3ff4c6f527128d972
2021-06-01 10:32:13 +00:00
Steven Ng 755723403b Merge "Don't dismiss keyboard after clicking X button on the widgets search bar" into sc-dev 2021-06-01 10:05:26 +00:00
Brian Isganitis a9a063294e Merge "Give each preference screen its own activity and toolbar title" into sc-dev am: 8d6ca68786
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14709732

Change-Id: I058985cbd1edbdb9cf1487eed4a51f9863cda0e7
2021-05-27 22:32:56 +00:00
Brian Isganitis 8d6ca68786 Merge "Give each preference screen its own activity and toolbar title" into sc-dev 2021-05-27 22:29:28 +00:00
Brian Isganitis 890d8d5a91 Give each preference screen its own activity and toolbar title
This change is in preparation for each preference screen having its own collapsible toolbar with its specific title.

Test: Subsettings open with activity transition and title changes
Bug: 187732263
Change-Id: Iac44d688539195ddb6c2aca0a96d737ce7727071
2021-05-27 16:08:22 -04:00
Steven Ng 7a36ad396e Don't dismiss keyboard after clicking X button on the widgets search bar
Test: Enter some queries in the widgets search bar. Click X button. The
      keyboard is still opened after the search queries has been erased.
Bug: 189454318
Change-Id: Icb0501cf36cbf1517e2da24044da44101fa86ed9
2021-05-27 18:42:31 +01:00
Pierre Barbier de Reuille 4bbd8623f9 Merge "Update the computation of the widget span from size" into sc-dev am: 0bb96c9168
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14736371

Change-Id: I88641547e683ca42b776cd300fc155e42761dddb
2021-05-27 12:32:00 +00:00
Pierre Barbier de Reuille 0bb96c9168 Merge "Update the computation of the widget span from size" into sc-dev 2021-05-27 12:11:27 +00:00
Pierre Barbier de Reuille 295a402908 Update the computation of the widget span from size
The new computation takes into account the new cell layout border
spacing.

Change-Id: Ic20e0906bbbaaf1e53475585e2a6ca31c277e09b
Bug: 187461595
Test: Manual testing, varying the sizes in a widget
2021-05-26 22:44:58 +01:00
TreeHugger Robot be401a7cdb Merge "Adjust the widgets fitting algorithm to mitigate over packing issue" into sc-dev am: 96793bdfe1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14717701

Change-Id: I20ed31a66c4fe1aed11dee6ad7ebb4db4422c9b7
2021-05-26 21:28:50 +00:00
Steven Ng b7773f93cf Adjust the widgets fitting algorithm to mitigate over packing issue
If we are fitting more than one widgets / shortcuts on the same row,
we will only allow the total width to be n - 1 cells, where n is the
grid width in cells.

Test: Run WidgetsTableUtils robolectric test.
Bug: 189103942
Change-Id: I2f23cb08fe95d68562188cc7b1852d99d7093dc0
2021-05-26 19:27:46 +01:00
Andras Kloczl 55edfe55f7 Add two panel home support for page binding logic
There's a logic which prioritizes the binding for the
current page and defers the other pages' binding.
If two panel home is enabled, we want to bind both pages
together. LauncherPageRestoreHelper has been created to
contain the logic for persisting restoring and calculating
which pages to load immediately.

Test: manual + run LauncherPageRestoreHelperTest robo test
Bug: 174464691
Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
2021-05-24 23:22:06 +02:00
Steven Ng 9f194ee290 Merge "Clear widgets search bar focus when the user taps outside the search bar" into sc-dev 2021-05-21 08:52:50 +00:00
Steven Ng 2c880a321d Merge "Fix WidgetsSearchBarControllerTest" into sc-dev 2021-05-20 23:43:11 +00:00
Steven Ng 427c143ef6 Fix WidgetsSearchBarControllerTest
Test: Run WidgetsSearchBarControllerTest
Bug: 188650001
Change-Id: I687d602f8d857061f71a8fba86c30ea3017065c1
2021-05-19 16:08:22 +01:00
Steven Ng 66034efaae Clear widgets search bar focus when the user taps outside the search bar
Test: Focus widgets search bar. Then tap outside the search bar and
      observe the keyboard is being dismissed.
Bug: 188540267
Change-Id: Ica1b5b804ed97dd0b1cd8d41351eddcf5249ded0
2021-05-19 11:31:09 +01:00
Sunny Goyal a76bc76317 Removing number of threads used in background execution
to prevent system thrashing

Bug: 188541475
Test: Presubmit
Change-Id: Iff73abeab813d1b80a1ff85b69723dce0bef8005
2021-05-18 13:43:50 -07:00
Sunny Goyal c52c0782a7 Merge "Adding support for determining split layout for launcher." into sc-dev 2021-05-04 22:33:38 +00:00
Sunny Goyal 19ff728b92 Adding support for determining split layout for launcher.
> Simulating the windo wmanager API to get available device
  profiles until final API
> When a device has multiple internal displays, and with both
  tablet and phone possibilities, it uses a split workspace layout

Bug: 186160341
Bug: 175782275
Test: Manual
Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-05-03 14:48:28 -07:00
Steven Ng 84298b3998 Add a flag to enable custom local filter for recommended widgets
Test: Run WidgetsPredictionUpdateTaskTest
Bug: 186648032
Change-Id: I2bd5e2c81f971e0a40a4b05c8cab2a7adb171f96
2021-04-28 18:47:33 +01:00
Tony Wickham 5df03e1585 Merge changes from topic "taskbar-hotseat" into sc-dev
* changes:
  Update taskbar to add extra hotseat items instead of recent apps
  Add support for having more hotseat icons in the DB than we show
2021-04-13 18:41:47 +00:00
Tony Wickham b87f3cdc1c Add support for having more hotseat icons in the DB than we show
Split InvariantDeviceProfile#numHotseatIcons into two variables:
numDatabaseHotseatIcons and numShownHotseatIcons. These are generally
the same, but different DisplayOptions within the same GridOption
can choose to show different numbers of hotseat icons while sharing
the same database.

numDatabaseHotseatIcons is used for all reading/writing/migrating
purposes, while numShownHotseatIcons determines how many Hotseat
icons to show in the UI.

Test: Existing tests pass, added two new migration tests
Bug: 184789479
Bug: 171917176

Change-Id: I54583504f61a47a4444b6a637ebb7e3ab31528b7
2021-04-12 16:08:15 -07:00
Pinyao Ting 199c469ed8 Merge "Fix BackupRestoreTest" into sc-dev 2021-04-09 20:13:15 +00:00