Commit Graph

3 Commits

Author SHA1 Message Date
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