Commit Graph

131 Commits

Author SHA1 Message Date
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 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
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
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 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 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 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 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 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 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
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
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
Pinyao Ting a39f45ba28 Fix BackupRestoreTest
Modified the test in comply with changes in Roboelectric framework.

Bug: 184793993
Test: wip
Change-Id: I31af8ea828d0070bb9161e553c5a5054e5d0b432
2021-04-07 19:40:02 -07:00
Sunny Goyal ce6cc7e705 Simplifying widget search pipeline
Bug: 183607616
Test: Verified on device
Change-Id: I3e5dd9e280f375475d1e1cf41dff6e6533175ebf
2021-03-30 16:54:34 -07:00
Alina Zaidi 2cff164be2 Clear focus from search bar whenever a header is clicked in search adapter.
Test: Manually checked
Bug: 183398749
Change-Id: Ie91312ae1e62c6427e3397d1e5f60bc812a790ee
2021-03-24 09:52:45 +00:00
Bob Badour 390b27e46c [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Launcher3
Added SPDX-license-identifier-Apache-2.0 to:
  quickstep/Android.bp
  robolectric_tests/Android.bp
  tests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I699e0796410f691ae7cf4802c41987d79e4e486d
2021-03-19 04:22:23 -07:00
Alina Zaidi 378ca5e920 Merge "Bug fixes for widget picker search." into sc-dev 2021-03-18 10:32:18 +00:00
Steven Ng 99060b30ca Merge "Adjust font, color, margin, corners for all widgets tray" into sc-dev 2021-03-18 10:25:00 +00:00
Sunny Goyal f5c42ea6aa Adding some build rules in Launcher3
Bug: 182502086
Test: Presubmit
Change-Id: Ib2c18f1e252b3382030293fd3b873e840320301a
Merged-In: Ib2c18f1e252b3382030293fd3b873e840320301a
2021-03-18 01:26:36 +00:00
Steven Ng 08ef694509 Adjust font, color, margin, corners for all widgets tray
Test: manually
Bug: 179797520
Change-Id: Ib78aae05e021da272ef2f754c876d24a4c14bcb0
2021-03-17 22:43:12 +00:00
Alina Zaidi 2e732e95d9 Bug fixes for widget picker search.
SearchBarController
- Use Extended Edit Text to handle close keyboard action well.
- On press enter while search remove focus from bar and hide keyboard.
- On cancel button press hide keyboard and also reset search targets to empty so that on next search session the previous results dont flash (show for a short time before reflecting users query).

WidgetsFullSheet
- Make sure expanded header are reset when user leaves personal/work recycler views. Search recycler view resets its expanded header on every search already.
- Show 'no search results' view if no search result present.
- Update WidgetListBaseRowEntryComparator to show personal profile widgets first.

Test: Tested prototype locally.
Bug: b/157286785
Change-Id: Ibaa208c4091783e14ac0887caf559e867185df5a
2021-03-17 14:43:04 +00:00
Alina Zaidi d07acba048 Add a WidgetsSearchBar(Launcher3) and a WidgetsSearchController.
- Make WidgetsSearchBar in Launcher3 initialize WidgetsSearchController with SimpleWidgetsSearchPipeline
- Modify SimpleWidgetsSearchPipeline to filter widgets entries on widgets/shortcut labels also.

Test: Tested prototype locally. Also added robolectric test.
Bug: b/157286785
Change-Id: I65f5fa0240ffb6d22023167e4e86d94d83bbd9f7
2021-03-15 11:25:08 +00:00
Alina Zaidi 334e65935b Have a recycler view to show search results.
-Have a recycler view layout for search widgets list.
-Make WidgetsFullSheet implement interface- SearchModeListener to get notified when user is using search and also when search results are ready.
-Have a WidgetsListSearchHeaderViewHolderBinder for search result headers which shows subtext in header as concatenated string of widget/shortcut labels.
-Modify WidgetsListAdapter and WidgetsDiffReporter to work well with search recycler view.

Test: Tested prototype locally. Also added robolectric test.
Bug: b/157286785
Change-Id: Ie29d9f295fddb6d727b5fc26a360f514f2f4a763
2021-03-11 21:27:51 +00:00
Alina Zaidi c322510b2a Merge "Implement pipeline for a simple search based on query string matching on app names in WidgetsListBaseEntries." into sc-dev 2021-03-11 00:18:00 +00:00
Steven Ng 3c08f580c3 Merge "Widgets recommendation backend" into sc-dev 2021-03-09 10:05:55 +00:00
Steven Ng 3a8353256a Widgets recommendation backend
Add a widgets recommendation mechanism based on AiAI app predication
ranking with the following changes:

1. Only one widget is picked from one app.
2. Widgets that are already added to the workspace are excluded from
   the recommendation.

Test: run PredicationUpdateTaskTest

Bug: 179797520
Change-Id: Ia697bc6df0bae75969e68b7b3de32d57901f7461
2021-03-08 23:37:51 +00:00
TreeHugger Robot d333224f19 Merge "Convert Launcher Android.mk to Android.bp to setup RoboTests" into sc-dev 2021-03-08 08:12:53 +00:00
Hyunyoung Song 5a007fe0f6 Convert Launcher Android.mk to Android.bp to setup RoboTests
Bug: 181083996
Test: m Launcher3 && install Launcher3 and test basic things
Test: m RunLauncherRoboTests (90 tests run and 3 fails)

Change-Id: Icdc839d06413409cbd52d10a5ef9fe27b0a57baa
2021-03-07 22:42:42 -08:00
Alina Zaidi c6fe0dd4fa Implement pipeline for a simple search based on query string matching on app names in WidgetsListBaseEntries.
This will be the default search for AOSP widget picker and a fallback search for Pixel widget picker.

Test: Tested prototype locally. Also added robolectric test.
Bug: b/157286785
Change-Id: Iad3bf2f46b2a89383a52c756fd1b9f65ecbeb40b
2021-03-07 21:23:37 +00:00
Yogisha Dixit 741fae9ea2 Move widget files into widget folder + add tests.
I will use the newly created LauncherAppWidgetProviderInfoTest in a follow-up CL to add tests for the newly added widget sizing APIs.

Test: Automatic: Ran all robolectric tests in launcher3,
      Manual: Added a widget, edited the widget, removed the widget
Bug: 179807199
Change-Id: I540b2dbe284c6eb5aa2466a1d13a9581ee59425b
2021-03-01 13:59:52 +00:00
Bob Badour 8182d214e1 Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Launcher3" am: 541d0855ac am: 3be35ec269 am: 8824a5cd61
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/1587746

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia1a355fb2ed5bebd8cfff2f5da2eef14428bfe15
2021-02-24 23:53:29 +00:00
Bob Badour 3be35ec269 Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Launcher3" am: 541d0855ac
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/1587746

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc96bfa8a3d59a19194a154baeaffaea1281af0a
2021-02-24 22:25:46 +00:00
Steven Ng e8d92342fa Replace horizontal ScrollViews with tables in the full widgets picker
Test: Run gnl test, AddWidgetTest
      Run Robolectric tests for widgets
      Manual test video: https://drive.google.com/file/d/1uwCtVNIlC9150kv5eEfILfP5r5M7ARYm/view?usp=sharing

Bug: 179797520
Change-Id: I2f4cdf84338a91b63967879d0c9268c312ace19b
2021-02-24 19:49:15 +00:00
Bob Badour 4bdf380625 [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Launcher3
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  Android.mk
  robolectric_tests/Android.mk
  tests/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia348bba8ca075e87070ff8a605ca79ffcbea9982
Merged-in: Ia348bba8ca075e87070ff8a605ca79ffcbea9982
2021-02-21 20:34:37 -08:00
Vinit Nayak a34af18b0e Update System settings content observer to cache values.
Existing ContentObserver will cache values and overwrite
them when the value itself is modified or caller force
updates.

Bug: 149571513
Test: Wrote unit tests, mostly for caching logic.
Not meant to test ContentObserver contract for registering an
observer.

Change-Id: I12835f6c2be27ce17f65a55c51c4ef85c63b4487
2021-02-16 20:58:53 -08:00
Hyunyoung Song c860448bca Merge "Fix WidgetsListContentEntryTest static initialization error" into sc-dev 2021-02-15 22:54:12 +00:00