Commit Graph

169 Commits

Author SHA1 Message Date
Cole Faust 1b9fd985d4 Replace .toList() with .collect()
.toList() was only introduced to android in api level 34, which is newer than
this module's min_sdk_version. Replace it with .collect().

This was found while updating android lint.

Flag: EXEMPT refactor
Bug: 394096385
Test: Presubmits
Change-Id: Id8d1de1531b67a7daf448e45592b7ef78f685fc2
2025-02-03 14:19:12 -08:00
Shamali P 7d64195793 Fix issue that recommendations were visible in landscape mode.
ag/30344959 showed the recommendations if available, to avoid the issue
of widgets list flashing when exiting search mode. However, we usually
hide recommendations in phone landscape due to the sticky header layout
not having enough space. In this fix, instead, we rebind recommendations
as before (to let the logic there decide whether to show or hide them),
and in order to fix the flashing problem that the earlier change was handling, we reset the recycler view.

Bug: 391231345
Flag: EXEMPT bugfix
Test: Manual, we don't have tests for interactions between screens
Change-Id: I535aa43cc553c9287c5d38ef7cde30f01e84d347
2025-01-22 16:19:35 -08:00
Shamali P aaf585aef2 Fix missing IME back animation in widget picker
Discussed with folks who worked on IME animation, and root cause seemed
to be picker unconditionally clearing the focus. Also, there is no
in-built way for clearing focus on other user interactions. So, had to
write custom logic to conditionally clear the focus.

Bug: 369933372
Test: See screencast (tested back, and other user interactions)
Flag: EXEMPT BUGFIX
Change-Id: I693bd27662563e5320159c082eb955a3bd5386f8
2024-12-10 16:28:05 +00:00
Shamali Patwa 780ce64f68 Merge "Don't bind scrollbar if current recycler view isn't changed." into main 2024-11-13 22:51:04 +00:00
Shamali P 4c727e38fd Don't bind scrollbar if current recycler view isn't changed.
Bug: 378417297
Flag: EXEMPT BUGFIX
Test: Installed app in bg with picker open and verified no scroll to top
Change-Id: I9b3c6a22c9b971f4d11bc6a6e534d4b6e0ca60bf
2024-11-13 19:45:28 +00:00
Shamali P 697dcf44ac Maintain selected or last header on clicking "Show all" button
Bug: 356127021
Test: Manual and tapl test
Flag: com.android.launcher3.enable_tiered_widgets_by_default_in_picker
Change-Id: I762695f9999e5ea4c722dbedde6d7efabd3ab0cb
2024-11-12 22:31:14 +00:00
Shamali P 35a25984c3 Update the widget picker UI to show the "view all" button
Screenshot test in follow up to include the button.

Bug: 356127021
Flag: com.android.launcher3.enable_tiered_widgets_by_default_in_picker
Test: Manual
Change-Id: Iac847361a0fa4a4b57d37e802ce6a7a5d8bb17d7
2024-11-07 14:01:39 +00:00
Shamali P be18ff2b7d Fix issue that items were invisible in 2-pane picker with talkback.
Bug: 371508727
Test: With talkback & screenshot tests
Flag: EXEMPT BUGFIX
Change-Id: Id8419e51bf20a38f203ce2422bae6290babcd63e
2024-10-25 23:00:36 +00:00
Brandon Dayauon 412821fadf Merge "Create an alpha letter scroller" into main 2024-08-26 20:21:17 +00:00
Brandon Dayauon 1f8f88696b Create an alpha letter scroller
- The function used is a raised cosine function to determine the sections to animate.

Tested flag: adb shell device_config put launcher com.android.launcher3.letter_fast_scroller true
Based on recent figmaspec, size of selected letter is 28dp and regular is 20dp. That means scaling should be 28/20.
Colors are:
onSurface for letter
surfaceContainer for background.
Figma shows selected colors are materialColorOnSecondary

bug:358673724
Test manually: https://drive.google.com/file/d/1gvJd5KoK8X_Sv8jXg1cZ65R4AuqHuvcd/view?usp=sharing
Flag: com.android.launcher3.letter_fast_scroller

Change-Id: Ia86eb0e8c41bc043fda3c44aeaf59e204429f337
2024-08-26 11:21:26 -07:00
Shamali P b3153f0bee Fix issue that personal list shows on unfold while on work tab (paused)
Bug: 358041878
Flag: EXEMPT bugfix
Test: on fold device with test dpc
Change-Id: I4b6d758cd4d98af941e2222db21a0307e1088867
2024-08-22 19:17:32 +00:00
Shamali P 5a1b372536 Update references that read popup data provider to use picker provider
Covers the UI references related to widget picker or its shortcut.

Test: Existing tests
Flag: EXEMPT minor refactoring
Bug: 353347512
Change-Id: Ifed1b7600ca9836df147949f3740ca1e89acd04a
2024-07-23 20:16:50 +00:00
Shamali P 6211e86009 Consider the widget option menu choice in search results
Makes the search related code separate from popup provider.

Bug: 347288851
Flag: EXEMPT flag in sysui
Test: Unit tests
Change-Id: I4534d5f70876ec0cf4e2d78030864f78a8bfabb9
2024-07-17 22:56:58 +00:00
Shamali P 9aabb9a9cb Show only filtered / default widgets in standalone activity by default
Bug: 347288851
Flag: EXEMPT flag in sysui
Test: b/339716822 to set it up
Change-Id: I71baac8897ce600f3c588eb3d48b9677e507145b
2024-07-17 22:56:49 +00:00
Shamali P 96ebf67b9f Update the title and description provided by intent params.
Bug: 347288851
Flag: EXEMPT flagged in sys ui
Test: Manual (automated covered in b/339716822)
Change-Id: I71f21bc48fd03dbbe2b3804b7fcade5940606917
2024-07-03 15:49:32 +00:00
Shamali P e4ca191001 [part-1] Perform doMeasure only once in WidgetsFullSheet
We already know the details used to calculate the insets while in
onMeasure, so, instead of measuring everything twice, we initialize
the maxSpansPerRow in onMeasure and then call doMeasure.

Bug: 346341156
Flag: EXEMPT bugfix
Test: Manual and screenshot
Change-Id: If080f1f91c69d2d54139d876c36eac8743a224ee
2024-06-20 19:36:38 +00:00
Shamali Patwa 50fa2e404f Fix the flaky screenshot test
The flake happened to be due to rebinding triggered on attachToWindow that reset the icon cache with placeholder icon

Based on what I see, instead of calling refresh and bind, just triggerring onWidgetsBound should be okay - assuming it was trying to bind view for case when theme or display size was changed while picker was open.

Bug: 337916664
Change-Id: Ic6f3ff9188e4c5eda141a948ffa0c2c7c685162e
Test: Screenshot test
Flag: EXEMPT bugfix for test
2024-06-06 14:07:03 +00:00
Shamali P 01d1c31ec7 Move item animator to its own class and use it only for full sheet
Bug: 335715046
Test: Manual
Flag: NONE BUGFIX
Change-Id: I6977e9854edcee385f5b7075f62dd1d8ff8dfdce
2024-06-03 18:07:21 +00:00
Willie Koomson 21379bfbbc Merge "Remove widget education tip dialog" into main 2024-04-26 20:23:21 +00:00
Willie Koomson d731ba2ff1 Remove widget education tip dialog
This change removes the widget education tip dialog, and the arrow
tip view. These are no longer needed now that taps are handled by
showing an add button.

Bug: 335318980
Test: `pm clear com.google.android.apps.nexuslauncher` and open widget
 picker
Flag: ACONFIG com.android.launcher3.enable_widget_tap_to_add NEXTFOOD
Change-Id: I9b24a41604880f5f94939c02b94f1a9f6a6c83d5
2024-04-25 22:56:36 +00:00
Shamali P 01a297942a Fix issue that expanded widgets appear before next item moved down
Issue - http://screen/AYyCKCWZH4uYeBp

* Before - http:/screencast/cast/NTc1NzE0MTg1NDk3ODA0OHwyNjA4ZmU5OC02ZQ
* After - http://screencast/cast/NDcyNTkzNzcyMjYyMTk1MnwxNmU1MTRmNy1jMw

Additionally, also fixes problem that fade in for some expanded sections
didn't always happen.

Bug: 332457155
Flag: N/A
Test: Manual (see video)
Change-Id: Iad3a341d9b992c72b61492d57db4faa96a06ecfa
2024-04-25 20:31:54 +00:00
Fengjiang Li 1529052dcf [Predictive Back] Swipe back within taskbar all apps should only scale down content view, rather than whole all apps sheet
Bug: 335467443
Test: manual - took a video
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TRUNKFOOD
Change-Id: I45980329f70ac1a8a8fc0e84be007f3385e40f58
2024-04-17 16:09:21 -07:00
Fengjiang Li 34f2c92e39 Merge "[Predictive Back] If back swipe while widget picker is in search mode, we should scale down the content view, rather than the bottom sheet" into main 2024-04-17 16:53:54 +00:00
Fengjiang Li 85a495f066 [Predictive Back] If back swipe while widget picker is in search mode, we should scale down the content view, rather than the bottom sheet
This will help indicate that we will be navigating within widget picker's bottom sheet.

Fix: 333524244
Test: manual - took a video
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Change-Id: If29806a474d35c0fdd5789cb67fa62dfbb313313
2024-04-16 17:13:22 -07:00
Willie Koomson dcc2d82d4e Scroll to show WidgetCell when it is tapped.
Scroll to show WidgetCell when it is tapped in a widget sheet.
Otherwise, the add button may show/hide without the user seeing
it if the bottom is clipped.

Bug: 329861721
Test: manual- tap WidgetCell when top or bottom is scrolled out of view
Flag: ACONFIG com.android.launcher3.enable_widget_tap_to_add TEAMFOOD

Change-Id: Ie21730c193e845cb1c1fa447b7c0a7e719984a8f
2024-04-15 22:32:48 +00:00
Shamali P 168d420440 Maintain the recommendations that were initially displayed
- The component names of the widgets shown on first opening the picker
are saved across orientation change - and only those shown initially are
displayed.

* http://screencast/cast/NDkyMDQ0OTg3OTI0NDgwMHw4ZGU1ZjRmNy0zNQ
* https://screencast/cast/NTc1NjQ1NDI5MTExMTkzNnxiZGJlMjQ2Yi01Ng

Bug: 331776686
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_suggestions TEAMFOOD
Test: Manual - see videos.
Change-Id: I6af7421c2757fde321d06406514ab2576a48fb47
2024-04-08 16:02:05 +00:00
Zak Cohen 4d341404c6 Align widget picker bottom swipe transition with predictive back.
Bug: 325930715
Test: widget picker tests
Flag: NA
Change-Id: I15319f0a264503ff34dd4cc0dc36a40531379e2b
2024-04-03 12:46:33 -07:00
Shamali P 809e1a8efb Fix issue that old search results list show up momentarily
After exiting the search, we clear the search results and hide the
results lists (because that recycler view shouldn't be accessible after it). However, it often doesn't get chance to layout the empty data.
So, the next time we show the search results list again with new data,
it first animates to clear the old results and then animates in the new
ones. In this fix,
[demo](http://screencast/cast/NDg5OTg2NzIyMTU1NzI0OHxhMTk0NzEzZS1hYw), we swap the adapter to remove any old views, because old search results aren't valid anymore. Spoke with yigit who worked on RV in past and they suggested swapAdapter
was fine for this.

Other options explored:
1. set item animator = null; so, it doesn't animate flushing out old
results -> but we want animations
2. delay the visibility update to let layout happen -> but, if we are
 hiding the section,  why wait making the other UI updates until
layout?

Bug: 274051332
Flag: N/A
Test: Manual
Change-Id: I9f9c5a67b47b5415b2d9e4caa23fd4b6daf7cdea
2024-04-01 23:07:03 +00:00
Fengjiang Li 9eee6df676 Don't toggle scrollbar during predicitve back swipe to avoid flicker
Fix: 329437430
Test: manual - attach video to bug
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Change-Id: I8c959fbb02948011be59a17752a140b1a07ca6b9
2024-03-25 16:34:44 -07:00
Shamali P 55f1a39c15 Update the available size for suggestions in small landscape heights.
Bug: 330514207
Test: TAPL test
Flag: N/A
Change-Id: I1e1f43a46f4aa339bcafac013817846d893b0a9b
2024-03-20 22:12:00 +00:00
Shamali P b081314330 Retain recommendations (if possible) while picker is open
Picker rebinds recommendations when size constraints change or
fold/unfold, but recommendations from popup provider may have changed.
This is an attempt at trying to maintain currently shown items
as much possible.

Also, align the pagination and title to the top in two pane picker
 (confirmed with David that we prefer this version)

Additionally, we don't show the widgets count for suggestions.

Bug: 318410881
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Test: Manual

Change-Id: I60799f9ad38da913c3e084d758f5b82c79cd641c
2024-03-19 21:26:14 +00:00
Shamali P 1076f176c2 Limit the recommendations space in two pane picker
- This makes the suggestion section non-overwhelming
- Currently it shows too many suggestions for user to find any value
- Limiting the height also allows pagination to feel smooth when showing
in categories

Bug: 318410881
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Test: Manual
Change-Id: Iab1f9a15bdd46ee1560734e30551bfb7c8a74a82
2024-03-12 23:47:07 +00:00
Fengjiang Li 7c6f770a41 [Predictive Back] Don't hide/reveal scroll bar in predictive back swipe in 2 pane widget picker
Fix: 328639347
Test: Manual - took a video
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Change-Id: I909cca47477d75c2dd9b861e3c7812b9540e6fa1
2024-03-07 16:29:14 -08:00
Shamali P ef4b102a08 Pause page scrolls while new recommendation are being applied
http://screencast/cast/NDg4NzU2MjI3NDQ3MTkzNnw5MTU1NTc4Yy1lYw
http://screencast/cast/NDk5Nzg4MzQ5MjMwMjg0OHxmZGM0MGZlYS0wMg

This cl is NO-OP for anything else using it already. Just renamed it.

Bug: 318410881
Test: Manual (see screencast)
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Change-Id: I55d599437b2554f58d635d11f2b603516b030f30
2024-02-21 04:15:46 +00:00
Shamali P b3a4d65bb7 Initial UI changes for displaying categorized suggestions.
Ordering changes and some more UI changes in follow-up.

Bug: 318410881
Test: See screenshots
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Change-Id: I77e7f4dcdda32e2921ae56721cddbe261832f0d8
2024-02-16 18:43:20 +00:00
Shamali P 62339981db Use full-width two picker in both orientations in tablets
The change is really for enabling display of categorical suggestions,
so using the same flag.

Bug: 315055849
Bug: 318410881
Test: See screenshots
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Change-Id: Ia98fdd6b827f31a63264128617f6a16ee0716bcc
2024-02-15 18:32:21 +00:00
Shamali P 933a05a2be Align items in the center within each table row within suggestions.
When differently-sized widgets OR widgets of same size but not filling
space in previews are shown side by side, the top alignment looks odd.

Besides, in the updated UX, we want them to be center aligned.

Bug: 318410881
Bug: 319152349
Flag: N/A
Test: Screenshot update in cl chain.
Change-Id: I52cd7d6a1b5397a3c4c9dea8b072792b3211a8d3
2024-02-15 18:32:21 +00:00
fbaron 88b89d68fb Restore state of widget picker on fold/unfold
Specifically:
-keep selected tab (personal/work)
-keep search results

Fix: 323406345
Test: WidgetPickerImageTest
Flag: ACONFIG com.android.launcher3.enable_unfolded_two_pane_picker TRUNKFOOD
Change-Id: I919e59484f3af7a2b3b007f5c234055a0f7276b3
2024-02-12 21:13:46 +00:00
fbaron 88676ba7bb Fix two pane widget picker bugs
Here we:
-Move no widgets text outside of the right pane so that we can center it
-setInset and change the clipping of children in the views so that we can fix the padding at the bottom when we have 3 button nav
-create selectedHeader where we keep track of the currently selected header in order to refresh the widgets for the selected header on rotation
-when widgets are bound we check if there are no recommended widgets, and if there aren't we select the first visible header

Fix: 324002996
Fix: 324001940
Fix: 323417968
Fix: 323460545
Fix: 323409306
Test: WidgetPickerImageTest
Flag: NONE
Change-Id: Ibd85cb086bb6c2aede6cf79da0c688a1fdaec4e5
2024-02-07 22:36:59 +00:00
Zak Cohen 3ae06bf4ca Hide widgets in the Work Profile tab when Work apps are paused.
The filter was missing from the refactor in ag/25502473.
There aren't currently WidgetPicker tests that would catch this behavior
but there should be.

Bug: 317452407
Test: Ran existing widget tests, looking at adding work profile tests.
Flag: none
Change-Id: I2ce8464a1c76505bfe7ce8cf4280bb5b576cdb1d
2024-02-02 13:28:39 -08:00
fbaron b3b0215cb1 Update two pane sheet widget picker to use RelativeLayout since ConstraintLayout was causing test failures
There are test failures when using ConstraintLayout without a known solution, see https://chat.google.com/room/AAAACwktJi8/2OogGWfbLvI. Switching back to a relativelayout to resolve those issues.

Bug: 301918659
Test: WidgetPickerImageTest
Flag: ACONFIG com.android.launcher3.enable_unfolded_two_pane_picker DEVELOPMENT
Change-Id: I004c2d77ca308d85b29217d4f1e548067126556f
2023-12-12 15:12:40 -08:00
fbaron eee16c7ac5 Update widget picker two pane to support foldables
Bug: 301918659
Test: WidgetPickerImageTest
Flag: ACONFIG com.android.launcher3.enable_unfolded_two_pane_picker DEVELOPMENT
Change-Id: I5beecf4f8c46235f3e89c7bd8aed65fd292883ce
2023-12-06 12:48:24 -08:00
Himanshu Gupta f63c645d8c Merge "Fixing work widgets tab in WidgetsFullSheet." into main 2023-12-03 23:33:42 +00:00
Himanshu Gupta c2a2b86e76 Fixing work widgets tab in WidgetsFullSheet.
Currently the work widget matcher matches against all
non-foreground user profiles, due to which the work
tab is incorrectly shown in widgets full screen, when
PS is present.
This was missed in ag/25129268 where a bunch of work
matcher fixes were done.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 312900122
Test: Launcher3 tests
Change-Id: I80d33e851ea3366dc3897bb1f5cc17fcd6b34520
2023-12-03 21:23:44 +00:00
fbaron eca18c0bd1 Fix flicker for widget picker
Fix: 312159033
Flag: NONE
Test: verified on device
Change-Id: I69e39c9041ff2d0a2ac3a6459a4c85c131a1b785
2023-12-01 10:52:39 -08:00
Sunny Goyal eb29313595 Updating WidgetSheets so that it can be displayed in any
activity and not just Launcher

Bug: 307306823
Test: atest Launcher3Tests
Flag: NA
Change-Id: I0e33323805c6e895e3a1639ecf5933e698212c65
2023-11-27 11:17:04 -08:00
Himanshu Gupta 9aab4d4603 Adding Prework for Private Space integration in Launcher
This Cl adds the following:
1. Fixes for Quite Mode check maintained by Launcher
2. Addition of new Quite Mode broadcasts
3. Fixes for determining work profile user correctly.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I5f6158b213723339e70ff99e66c5f439f5879e12
2023-11-05 12:31:10 +00:00
Sunny Goyal 576f7a5e80 Removing some usage of shared prefs
Bug: 301661768
Test: Presubmit
Flag: N/A
Change-Id: I158e9a5148d2c9404ea4d2e9e239696b29dbeb20
2023-10-06 14:35:56 -07:00
Sebastian Franco 2023b359b7 Making sure window inset controller is not null
In some cases the controller can be null if the view is no longer
connected to the window.

Also, this issue seems to only happen in cuttlefish instances so there
might be a weird behaviour going on there but in any case is good to check
for nulls.

Test: No testing require is only null checkin, just making sure it compiles.
Bug: 302869930
Change-Id: I88d6091b57293e9493385185bfeb3e470c9bad84
2023-10-04 13:18:18 -07:00
fbaron 2553ec02b7 Cleanup LARGE_SCREEN_WIDGET_PICKER flag
Fix: 270395809
Flag: no flag
Test: WidgetPickerImageTest
Change-Id: I99734ae7f87b4c2c7b4e798d14cd12f473daac6e
2023-09-27 15:43:07 -07:00