Commit Graph

11 Commits

Author SHA1 Message Date
Federico Baron
e8217b3c1b Add ripple effect when a header in widget picker is selected.
We need to use setSelected in order to add a ripple effect when a header is selected in tablet landscape mode, and to set the style through XML rather than programmatically the way it was done before in the method `setLargeScreenTheme`.

Fix: 268558453
Test: Turn on LARGE_SCREEN_WIDGET_PICKER and verify that when selecting a header there's a ripple effect on that header
Change-Id: I6cab920258a57118430d1e07416508ef36faa56d
2023-02-21 16:33:18 -08:00
Sunny Goyal
77e732a1c4 Moving widget background to xml, so that the same constantstate is
used for all entries

This helps reduce launcher memory by avoiding multuple duplicate
drawable generation

Bug: 268646258
Test: Verified on device
Change-Id: I829750f081cfce65063b35a614b903066d9a4bed
2023-02-13 05:49:31 +00:00
Steven Ng
43859f10bc Group weather widgets under the widget category
Test: manual (see video in bug) and added PackageUserKeyTest
      Also tested pending conversation widget to ensure the right icon
      is shown.
Fix: 201062480
Change-Id: If23c28bd93c54fb1747648309ab3c238a1810902
2021-09-30 14:22:21 +01: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
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
Stevie Kideckel
d93feeba0a Fix corner radius for expanded widget picker list items
Also create the drawables at runtime to avoid all the permutations

Fix: 189329394
Test: verified locally
Change-Id: I0497759ff68bd4ae6b1635423cfd4713f06d349f
2021-06-04 13:04:04 +00:00
Steven Ng
f4fb4d9429 Fix corner radius for single item in the widgets tray.
If there is only one item, corner radius at 4 corners should be 28dp.

Test: Corner radius of one item is correctly shown in the widgets
      picker.

Bug: 183382610
Change-Id: Ief46af8c41ce944792d08212e93f7d68c6278d05
2021-03-22 16:30:57 +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
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
Steven Ng
e92bc55d12 Make all widgets collapsed in the full widget picker by default
Changes:
1. Add a WidgetListHeader view for showing icon, app name and a subtitle.
2. Only WidgetListHeaders are always visible to users in the full widget
   picker.
3. Only one widgets list from an app is visible in the full widget picker
   at any one time.

Test: Auto: run add robolectric tests under widget/picker
      Manual: Open full widgets picker. Then, expand and collapse apps.
      Video: https://drive.google.com/file/d/1gzfeEm5IOAu0qHsO77OTS2eMfU7CHJiL/view?usp=sharing

Bug: 179797520
Change-Id: Idac58be23dfeafcb79b3c61b4972d3addb462de1
2021-02-15 17:46:38 +00:00