Commit Graph

19 Commits

Author SHA1 Message Date
SuperDragonXD
f686b13f8b Re-theme Launcher3 components (#4068)
There were some themes that were remove during the 14 and 13 merge. This commit attempt to fix it.

---------

Co-authored-by: John Andrew Camu <werdna.jac@gmail.com>
2024-02-11 09:00:46 +08:00
Sebastian Franco
0a1328d9fb Adding back the badges on widgets for widget recommendations.
Test: Manual Testing
Fix: 202956924
Change-Id: I859d3d93d95bdc8d0742eb6b5dd40ad12a386928
2021-11-17 15:08:09 -06: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
Steven Ng
6fe115b2ae Fix shortcut size calcuation
Shortcut size should be the size of all apps icon + padding

Test: Check shortcuts and widgets are shown without crash in the
      following surfaces with display & font set to largest and
      display cutout enabled. Repeat the same test with normal
      display setting and no cutout.
      1. Full widgets picker
      2. Bottom widgets picker
      3. Pin widget dialog
Fix: 193422438
Change-Id: Ibfebf94e92eed5e9cd1dd4196d98823b0e4dda6b
2021-07-13 12:46:31 +01:00
Pierre Barbier de Reuille
a7b3a14e75 Use the computation of the widget size including padding.
Found all the uses of getWidgetSizePx and replaced them with the
computation of padded sizes (checked it all made sense).

Test: Try the various widget pickers.
Bug: 191612352
Change-Id: Id2a8d12ee7ce6baabef186dbb78d817975ea2212
2021-07-02 10:04:06 +01:00
Yogisha Dixit
658c5dafd4 Log widgets source.
Test: manual
(1) Upgrading to new DB version is successful (no errors thrown in logcat)
(2) Widgets that were added with the old DB version have CONTAINER_UNKNOWN as their source container
(3) Widgets that are added with the new DB version still log source container after reboot
Bug: 185778648
Change-Id: Iaa38f0be6bc4cb0d29842f9a2ea0d08de000c930
2021-06-30 17:48:14 +00:00
Steven Ng
bc5099e9a6 Fix height estimation of the widgets recommendation table
There are two vertical paddings
1. Table padding
2. Widget cell padding

We haven't taken account the widget cells padding

Test: Manual
Bug: 189814077
Change-Id: I9b1dc9e880d4402b9c461d0024a0748c0afc408a
2021-06-10 16:57:40 +01:00
Steven Ng
7e06df2b50 Use WidgetSizes to estimate widget size instead of custom calculation
Also fix 2 bugs in WidgetCell
1. preview layout: padding is added to the AppWidgetHostView rather
   than the preview container. We shouldn't add padding to the size
   of the preview container.
2. widget_preview_shortcut_padding is a padding added to shortcuts but
    not widgets.

Test: Open full widgets picker and observe widgets are rendered
      correctly in the widgets recommendation table. Also, observe
      the generated bitmap images are correctly rendered.
      Run AddWidgetTest.
Bug: 189975670
Change-Id: I00db3200e0b61dc5e82f3c4bfdf34e197ea20314
2021-06-08 11:48:11 +01:00
Steven Ng
3417c1d22b Remove debugging logs from the full widgets picker
Test: None
Bug: 185508758
Change-Id: I2958118abc9d4f3778aaf6c3e3df01b0712354dc
2021-04-28 19:27:40 +01:00
Steven Ng
c7d7410178 Include recommended widgets table vertical padding in the height estimation
Test: run AddWidgetTest, AddConfigWidgetTest
Bug: 186450511
Change-Id: If306b569058edb3edb3c741199e9c0d96a88f412
2021-04-26 22:19:58 +01:00
Steven Ng
5ee8b330dc Fix recommended widget table height calculation
Include the widget preview padding in the height calculation

Test: Run AddWidgetTest
Bug: 186138174
Change-Id: Iebb7ebb6ba1c6fc527ba94440bc16f84f63017b4
2021-04-23 12:45:44 +01:00
Steven Ng
260e98385e Use cellHeightPx to estimate recommended widgets' height
Test: Set grid to 2x2 and open the widgets picker in portrait. Able to
      scroll the recycler view.
Bug: 185915917
Change-Id: I02bb11a999fb1816de6e2410810c4ae6c1da137f
2021-04-21 14:43:30 +01:00
Steven Ng
769a14ef34 Use availableHeightPx to calculate the max height for recommended widgets
heightPx doesn't take device orientation and system taskbar into account.

Bug: 185508758
Test: Open widgets tray, observe recommended widgets. Rotate the screen
      and observe recommended widgets.
Change-Id: I96f1817f96ba643e54e1d2599225254489091d03
2021-04-19 22:06:38 +01:00
Steven Ng
29f6b0ba05 Add debug logs for widget recommendation down scale calculation
Bug: 185508758
Test: None
Change-Id: I0b4789075bcc5ffc26f30dcd483f7c97bee9f410
2021-04-16 18:39:45 +01:00
Steven Ng
8b097ce381 Merge "Fix drag-n-drop for recommended widgets" into sc-dev 2021-04-09 17:15:33 +00:00
Steven Ng
f7b7faed77 Fix drag-n-drop for recommended widgets
Bug: 184917820
Test: Drag-n-drop a recommended widget from the all widgets tray
Change-Id: If9efffc2e156836ff1b4048c3d40782ba4d5976b
2021-04-09 15:26:31 +01:00
Steven Ng
f22239191d Set a max down scale ratio for recommended widgets
If the down scale ratio is smaller than the max down scale ratio,
recommended widgets won't be shown

Bug: 183500375
Test: Rotate to landscape on Pixel 3 and then launch widget picker.
      Recommended widgets are not shown. Rotate to portrait.
      Recommended widgets are shown.
Change-Id: I48b76b23c5bf505c79da82c7b27ea4db85f5d717
2021-04-09 14:54:35 +01:00
Steven Ng
4235fc129c Renders widget recommendations
Update the tapl test logic to scroll a smaller distance to avoid the
search bar blocking the target touch area.

Test: Open full widgets sheet and observe the widget recommendations
      shown at the top.
      Run AddConfigWidgetTest

Bug: 179797520

Change-Id: I6d53bbb46e2cb928ed7d015aaac604be17d33178
2021-03-19 21:11:32 +00:00