Commit Graph

10 Commits

Author SHA1 Message Date
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
0571a370d1 Use default spans as min spans if the min spans > default spans
This is to match the behavior described in
AppWidgetProviderInfo#minResizeWidth/Height documentation.

Test: run LauncherAppWidgetProviderInfoTest
Bug: 191223844
Change-Id: I37c0c8bf5e4588919e5b30fab6d2fde7236e114b
2021-06-23 17:11:05 +01:00
Steven Ng
1d47d8c705 Use grid size as the upper bound for widgets' default size in initSpans
Test: In Pixel 4, drag a monthly view Google calendar widget to a new
      home page from the full widgets picker. The widget outline is
      correctly shown.
Bug: 189060113
Change-Id: I33113b29cc8923098de95f1d5eb14c2b02429de1
2021-06-08 14:15:50 +01:00
Pierre Barbier de Reuille
295a402908 Update the computation of the widget span from size
The new computation takes into account the new cell layout border
spacing.

Change-Id: Ic20e0906bbbaaf1e53475585e2a6ca31c277e09b
Bug: 187461595
Test: Manual testing, varying the sizes in a widget
2021-05-26 22:44:58 +01:00
Yogisha Dixit
0b15c7ee07 Log widget features.
Design doc: go/widgets-logging
Note that this doesn't log dynamic colors yet. I'll work on that in a
follow-up CL.

Bug: 185778648
Test: manual
Change-Id: I04249ef267907b4112c220fb206e077d1bee783a
2021-05-15 00:26:41 +01:00
Sunny Goyal
19ff728b92 Adding support for determining split layout for launcher.
> Simulating the windo wmanager API to get available device
  profiles until final API
> When a device has multiple internal displays, and with both
  tablet and phone possibilities, it uses a split workspace layout

Bug: 186160341
Bug: 175782275
Test: Manual
Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-05-03 14:48:28 -07:00
Yogisha Dixit
73c8a366a8 Add a button for reconfiguring widgets.
Test: manual
Bug: 183316993
Change-Id: I17bec121e3d07d65979c2b92c285e487a7d64d65
2021-03-24 13:34:29 +00:00
Yogisha Dixit
c42e49f535 Use targetCell[Width|Height] as default widget size.
Test: Created a widget and manually tested the following scenarios
  - targetCell[Width|Height] not specified
  - targetCell[Width|Height] larger than maxResize[Width|Height]
  - targetCell[Width|Height] smaller than minResize[Width|Height]
  - targetCell[Width|Height] within max/min bounds
Bug: 179807199
Change-Id: I55a9dd2f94aa450ba6362301f7ac5ba4ee42f44d
2021-03-16 14:41:55 +00:00
Jon Miranda
611dba4c94 Use grid border spacing as widget padding if possible.
Widget padding is added by the system to create reliable consistency
between widgets.

Now that we have added border spacing between cells on the launcher
grid, we have significantly decreased the available space for widgets
on home screens: widget padding is 8dp on all sides, border spacing is
currently spec'd to be 16dp.

We can inset the widget padding added by the system, and instead rely
on the border spacing between cells to create reliable consistency
between widgets.

Bug: 175329686
Test: manual
      turn CellLayout#VISUALIZE_GRID debug flag on
      test drag and drop, resizing using drag handles
      view measurements in go/web-hv
Change-Id: Iabb9f45e82e4ae039f55d7fd27fbd0d23be60191
2021-03-02 15:06:46 -05:00
Yogisha Dixit
741fae9ea2 Move widget files into widget folder + add tests.
I will use the newly created LauncherAppWidgetProviderInfoTest in a follow-up CL to add tests for the newly added widget sizing APIs.

Test: Automatic: Ran all robolectric tests in launcher3,
      Manual: Added a widget, edited the widget, removed the widget
Bug: 179807199
Change-Id: I540b2dbe284c6eb5aa2466a1d13a9581ee59425b
2021-03-01 13:59:52 +00:00