42 Commits

Author SHA1 Message Date
Pun Butrach
ca0fe79dfd build: Avoid srcDirs deprecations
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
2026-02-02 00:48:27 +07:00
Pun Butrach
8c489023f6 build: Add Kotlin to source
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
2026-01-17 20:04:14 +07:00
Pun Butrach
c7e19be594 build: Migrate removed deprecated features to slightly deprecated features
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
2026-01-16 18:18:59 +07:00
Pun Butrach
ec7802ddd1 fix merge from 16-dev to qpr1 problem 2026-01-10 20:51:19 +07:00
Pun Butrach
436b59f0d4 Milestone D3R3, continue to D4R1 2026-01-10 20:51:17 +07:00
Pun Butrach
ba6a8df5fc fix: Module bugs 2026-01-10 20:48:14 +07:00
Bill Yi
1b4d3779b7 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import

Bug: 427569576
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:25701274c435e209c675272bd59deee6b07d6fd6)
Merged-In: Ie087b2d49dc9fab339f3372b79029ab3f533a2a6
Change-Id: Ie087b2d49dc9fab339f3372b79029ab3f533a2a6
2025-07-09 19:28:42 -07:00
Bill Yi
7e7a2216c2 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import

Bug: 424307548
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:792705c5cfca8468ace6663eb843198bc691287d)
Merged-In: If89b67af2bd2d14a53ef8572099059c6ae154b6a
Change-Id: If89b67af2bd2d14a53ef8572099059c6ae154b6a
2025-06-25 21:04:40 -07:00
shamalip
077234aff5 Widget Picker: Update the launcher integration to support shortcuts
Updates drag and drop, tap to add and preview related code.

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Drag and drop shortcuts on home screen
Change-Id: Iccfe329296dbf4b0770628e77df5cd9b42ac9b21
2025-06-08 20:40:21 +00:00
shamalip
d885e21660 Widget Picker: Update UI layer to support shortcuts
Updates the relevant references to read from the appropriate widget info
 object.

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Open picker for home screen and lockscreen hosts
Change-Id: I1b2a543b69686d859775618a406901591a32f555
2025-06-08 20:10:54 +00:00
shamalip
bb86bde284 Widget Picker: Update data layer to support shortcuts
Adds sealed class for widget info that can contain either appwidget info
or shortcut info.

Also kept the aosp config.xml empty to keep everything eligible for
 featured

Bug: 370950552
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Open picker for homescreen and lockscreen hosts
Change-Id: Iceafc2c1234063b16421f90bf00cf96114e9870c
2025-06-08 20:10:53 +00:00
shamalip
9540fc9149 WidgetPicker: Pass no widgets available message to widgets list
- Shows an error message when there are no widgets to show.
- Also adds a spacer item for edge padding to offset floating toolbar.

Bug: 408283627
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Unit tests
Change-Id: I30f8245c60be0cbaafc287efca8384eee863e7ca
2025-06-05 20:03:25 +00:00
shamalip
dfe273543f WidgetPicker: Implement no widgets available message
- Shows an error message when there are no widgets to show.
- Also adds a spacer item for edge padding to offset floating toolbar.

Bug: 408283627
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: Test changes
Change-Id: I89e78a9dafc23bb02be13e6fde08971835ff18f0
2025-06-05 13:50:48 +00:00
Shamali Patwa
1dd8075f28 Widget picker: add test tags for major screen components
Adds test tags intended to be used from UI automator tests.

Bug: 408283627
Flag: EXEMPT independent module
Test: Test changes
Change-Id: I06b58ebb6f48906fd6e1dd1be74b011d226ce797
2025-06-04 10:22:23 -07:00
Shamali Patwa
afa97055fa Update various tests to prepare for the new picker UI
- Switched the tests that probe old picker to use disabled flag
- Added some more tests for new code
  - A test to use the tap to add listener to add widget to homescreen
  - Updated compose unit test to cover for expanding an item

Bug: 408283627
Flag: EXEMPT independent module
Test: Test changes
Change-Id: I238896ec6e24596db93953a22bb43f6c7abbb9d1
2025-06-03 17:37:40 -07:00
Shamali Patwa
bdc7e215b7 Update picker tests to wrap content with widget picker theme.
Bug: 408283627
Flag: EXEMPT independent module
Test: Not applicable
Change-Id: Ied4f4ddca313262bc125b9fb98e5f2670333375b
2025-06-03 06:00:35 -07:00
Shamali Patwa
ceccd4a155 Replace the color / text style tokens with the newly defined picker specific tokens
Also minor adjustments on where color is applied vs clipping / scroll modifiers are applied.

Bug: 408283627
Flag: EXEMPT independent module
Test: See demo
Change-Id: Ie5270f27d6cb8a6fc1984d6421937b1d8763aee9
2025-06-03 06:00:26 -07:00
Shamali Patwa
7423dafef0 Define composition locals for configuring color / font tokens specific to widget picker.
This is so, launcher can map it to existing resource tokens enabling
launchers to easily override resources.

Within picker module, we define a default implementation using material
tokens that can be used as reference for which colors are ideal for
specific picker tokens.

Bug: 408283627
Flag: EXEMPT independent module
Test: See demo
Change-Id: I9c3a6118942114d5a8481f05a6710d8161d56bd7
2025-06-02 21:27:25 -07:00
Shamali Patwa
acc353194f Implement tap-to-add and drag and drop in the compose widget picker
- adds the logic to toggle add button on tapping preview / details
- adds logic to handle add button click
- adds logic to start drag and drop on long press.

The compose's drag and drop handles drag and drop itself, but in this case we need custom interaction to be able to support calling back listeners / setting result for activity etc. So, we use custom logic with android view.


Bug: 408283627
Flag: EXEMPT independent module
Test: See demo
Change-Id: Ie13c919248f8bdd20f90c4eb4a0bec266aedde27
2025-06-02 18:47:01 -07:00
Shamali Patwa
6710f2faf2 Pass down the widget interaction callback and flag on whether to support drag shadow
Bug: 408283627
Flag: com.android.launcher3.enable_widget_picker_refactor
Test: N/A
Change-Id: I8d04cb3b0e52c202bf6223e0b0e2e10a4ca6fdb8
2025-06-02 18:46:54 -07:00
Shamali Patwa
97cbe1c132 Add dagger2-compiler to some of picker module targets.
Also mark factories with widget picker annotation.

Bug: 408283627
Flag: EXEMPT independent module
Test: dagger compilation
Change-Id: I716e6cd2eefe44db9a597a80329631484089e84b
2025-05-29 13:26:15 -07:00
Shamali Patwa
8e1ac2de44 Repository and datasource implementations backing the widget picker.
Bug: 408283627
Flag: EXEMPT independent module
Test: Existing tests
Change-Id: I0f0b68c25f416c8494f363ecc93a388570f8dfa6
2025-05-28 16:49:18 -07:00
Shamali Patwa
7de040acac Update widget picker component to define dependencies and provide full catalog for clients to use.
Bug: 408283627
Flag: EXEMPT independent module
Test: Not applicable.
Change-Id: I573036882472c44de7024322a6ed2aa037eab277
2025-05-23 12:12:36 -07:00
Shamali Patwa
df07059bd4 Add widget picker search screen.
This adds the search screen and view model logic. 

It uses the same composable structure as the landing screen.

Bug: 408283627
Flag: EXEMPT independent module
Test: Unit tests
Change-Id: Ic83090be21b31a4f1b416284f78d5a05d5cd2cdc
2025-05-23 12:12:27 -07:00
Shamali Patwa
e7e3a14e95 Adds widget picker landing screens
This CL includes following:

*   ViewModel base class for reuse across widget picker.
*   Landing screens implemented in both compact and expanded mode.
*   Test cases for the same.

Bug: 408283627
Flag: EXEMPT independent module
Test: Unit tests
Change-Id: Ia4a7f0b972ca0d3863f041aac276cb3c5096a258
2025-05-23 11:52:46 -07:00
Shamali Patwa
cd2104334c Add WidgetsInteractor that enables view layer to interact with widgets
- This is responsible for looking up data from repositories and applying
business rules using use cases.

Bug: 408283627
Flag: EXEMPT independent module
Test: Unit tests
Change-Id: I767186a38b3105085637c75d9aec8ca21788f49f
2025-05-22 16:37:46 -07:00
Shamali Patwa
d3c07f8e9c Add use cases in widget picker domain layer that apply business rules.
These will be used by the interactor classes to provide data to the
ui layer.

- FilterWidgetsForHostUseCase filters widgets that don't match the
 constraints specified by the host
- GroupWidgetAppsByProfileUseCase groups widgets based on their user
profile; and ensures that if work profile is paused, its widgets are
 treated as empty list.

Bug: 408283627
Flag: EXEMPT independent module
Test: Unit tests
Change-Id: I676715daf5e400ba12acf50f867a5aa352d7bdf1
2025-05-22 16:03:27 -07:00
Shamali Patwa
a4ffc73d92 Updates to repository interfaces & data types for widget picker
- I think the previews / featured / search all could be part of widgets
 repository. Internally, it will use separate datasource to prepare the
  respective data - but as a repository, they all are probably just
  a widgets repo.
- Includes minor changes to data types as well to prepare for upcoming
changes.

Bug: 408283627
Flag: EXEMPT independent module
Test: Not applicable - interface changes
Change-Id: I765c11318a655603becdf2cab081f0fcf777da1a
2025-05-22 16:03:16 -07:00
Shamali Patwa
0b3a0df76a Add test for widget previews using remote views.
Bug: 408283627
Flag: EXEMPT independent module
Test: WidgetsGridScreenshotTest:widgetsGrid_remoteViews
Change-Id: I4ce8eb92269af13207180e50793e65e23958cd00
2025-05-19 13:12:10 -07:00
Shamali P
4d7992617b Add preview for widgets using layout / remote views.
Bug: 408283627
Flag: EXEMPT independent module
Test: WidgetsGridScreenshotTest:widgetsGrid_remoteViews
Change-Id: I70dd1438d12729fb85bead5ffdacb4fbc26fb29c
2025-05-19 13:12:02 -07:00
Shamali Patwa
6cea97c382 Disable the flaky compose screenshot test
There seems to be some flakiness with fonts; while I figure it out,
disabling the tests.

Bug: 418064758
Flag: EXEMPT test
Test: Not applicable.
Change-Id: I4ff19db8a18c76814a9af0d0589f1a2aa90d68d1
2025-05-19 07:06:25 -07:00
Shamali P
0725160c04 Add a widget apps list and the header composable for widget picker.
Can either be selectable on click or expandable.

Bug: 408283627
Flag: EXEMPT independent module
Test: will be part of larger screenshot test
Change-Id: I991164c54d52cd64effff4987ff6c55107acb149
2025-05-13 17:13:56 -07:00
Shamali P
ef8d996924 Add screenshot tests for the widgets grid in picker
Covers entire grid area with test samples of varying sizes for testing
 the grid placement logic.

Bug: 408283627
Flag: EXEMPT independent module
Test: Screenshot test
Change-Id: I5a4ab0d000e33b71de3760b729922f26445b0e8c
2025-05-13 17:12:57 -07:00
Shamali P
aa6159b111 Implement a grid of widgets for displaying in widget picker
BYPASS_LARGE_CHANGE_WARNING
Bug: 408283627
Flag: EXEMPT independent module
Test: Screenshot test

Change-Id: I0139faa9e522dc8f1fcf3b5fbf3362b5ec07047d
2025-05-13 23:13:59 +00:00
Shamali P
ce557540d7 Add widget preview composable for widget previews in picker
This cl contains just the image previews, the remote view ones in
 follow up

Bug: 408283627
Flag: EXEMPT independent module
Test: See grid screenshot test
Change-Id: Icf5e7eb98f6714b4a2954dcb9fcf75c0249a4d35
2025-05-13 23:12:11 +00:00
Shamali P
4f730ad128 Add details composable for details shown below widget previews in picker
Bug: 408283627
Flag: EXEMPT independent module
Test: See grid screenshot test
Change-Id: I08dfb5fcca9aaf3b630ab1c6ec56fad613127a17
2025-05-13 23:12:11 +00:00
Shamali P
ceab4fe654 Add a temporary component to display app icon for widgets list
This would be replaced with dependency on icon library (whenever that's
available).

Bug: 408283627
Flag: EXEMPT independent module
Test: will be part of larger screenshot test
Change-Id: Ifeff459fd679308a8f8a33d51f99db19898eedd5
2025-05-13 19:10:05 +00:00
Shamali P
851cbe3253 Make title optional on the widget picker bottom sheet & update insets
- Optional title will allow us to skip it in landscape and make more
 space
- Applies display cutout inset to the content instead of sheet, to make
 it appear edge to edge -- this isn't case today, but its a new request
  from UX

Bug: 408283627
Flag: EXEMPT independent module
Test: will be part of larger screenshot test
Change-Id: I035bbde1dcca990179c69a3bc1f2175d85a212ea
2025-05-13 17:14:51 +00:00
Shamali P
901b069a1c Add a search bar for widget picker in compose
Bug: 408283627
Flag: EXEMPT independent module
Test: will be part of larger screenshot test
Change-Id: I933357a98b014f19f5ee8a9e81f02a221a3731e2
2025-05-13 17:14:51 +00:00
Shamali P
e244e93c6a Add an option to show shadow on the floating toolbar.
In case of two pane layout, the toolbar appears over the list, so, shows
a shadow.

Bug: 408283627
Flag: EXEMPT independent module
Test: Screenshot test
Change-Id: Ifd126adc7dcbd81907809c961577f958c0f9c06b
2025-05-13 17:14:51 +00:00
Shamali P
dc587e5601 Add top level reusable layouts for widget picker
Bug: 408283627
Flag: EXEMPT independent module
Test: See demo; will be part of larger screenshot test
Change-Id: I10ebc3982b9c64b4b475a3d2201bf1afb1ad654a
2025-05-13 17:14:51 +00:00
Shamali P
22ed792253 Move widget picker directory to be under launcher3
Bug: 408283627
Flag: EXEMPT independent module
Test: Unit tests
Change-Id: Ife6bfb3579f4a9923c6c657b1dcca33c94aada4a
2025-05-09 21:27:36 +00:00