Commit Graph

6 Commits

Author SHA1 Message Date
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
Pierre Barbier de Reuille
199aec50ad Avoid calling AppWidgetHostViedw#updateAppWidgetSize
We cannot call it anymore, because the system padding is not always
used.

Bug: 191612352
Test: Manually, using CtsVerifier and dedicated widgets
Change-Id: I06353ba49a8e62127e593cdbcb86fadcf89ecb24
2021-07-02 10:03:44 +01:00
Steven Ng
54b5424548 Revert "Deduct padding from widget size only if padding has been inset"
This reverts commit 71cefb593f.

Reason for revert: The default padding is added by the framework not the launcher. We really need to subtract padding from the size.

Bug: 190498032
Change-Id: If7f164da34aec3d8e022ef2c752b72292cca0489
2021-06-18 09:37:44 +00:00
Steven Ng
71cefb593f Deduct padding from widget size only if padding has been inset
Test: Set the grid to 4x5 (without padding) and verify the min / max
      size sent to Conversation widget is expected.
Bug: 190498032
Change-Id: I8ef6e5d897ebd0e2ea9af4497b00059c8dfad70a
2021-06-17 00:15:52 +01:00
Steven Ng
22b6039270 Exact widget sizes functionalities into an utility class
Test: resize widget, move widget, add widget.
Bug: 189975670
Change-Id: Ia0bc2297891e1cfa33697e985064db5d1dcdfc8b
2021-06-08 11:42:48 +01:00