Commit Graph

8 Commits

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