Commit Graph

10 Commits

Author SHA1 Message Date
Sunny Goyal
6c304b157d Always insetting the widget by a minimum of 6dp
Removing default widget padding logic. Also widget padding it applied
at ShortcutAndWidgetContainer so that the widgetView always has the
correct size.

Bug: 274826296
Bug: 257589413
Test: Verified using screenshots
Flags: N/A
Change-Id: Id4b5e94db6ec7b2aa3dca87b1e9ccc831b608cac
2023-05-03 12:18:33 -07:00
Alex Chau
bcde1d5aa9 Log sizes being sent to widgets
Bug: 267448330
Test: manual
Change-Id: I25039c9c5721f4746a07e701caffacd0c7bd2609
2023-02-03 17:16:03 +00:00
Thales Lima
78d00adcbe launcher: create more space options
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
2021-10-05 12:26:05 +01:00
Steven Ng
6d8deb32f6 Fix getWidgetItemSizePx estimation
The size returned by getWidgetItemSizePx is used by the widget picker
for the NavigableAppWidgetHostView. We should NOT deduct the padding
applied to NavigableAppWidgetHostView to this size.

If a launcher grid insets NavigableAppWidgetHostView, then we must
add the inset to the NavigableAppWidgetHostView width / height.

Test: Compare the size of widgets in preview and home screen using
      layout inspector. See screenshots in the bug
Fix: 200983939
Change-Id: I35022861b65f2624f69940cf3856d9c47f8dbbd9
2021-09-27 15:01:04 +01: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
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