Replace horizontal ScrollViews with tables in the full widgets picker

Test: Run gnl test, AddWidgetTest
      Run Robolectric tests for widgets
      Manual test video: https://drive.google.com/file/d/1uwCtVNIlC9150kv5eEfILfP5r5M7ARYm/view?usp=sharing

Bug: 179797520
Change-Id: I2f4cdf84338a91b63967879d0c9268c312ace19b
This commit is contained in:
Steven Ng
2021-02-19 21:29:18 +00:00
parent 1408c6459c
commit e8d92342fa
11 changed files with 475 additions and 108 deletions

View File

@@ -43,4 +43,20 @@ public class WidgetItem extends ComponentKey {
activityInfo = info;
spanX = spanY = 1;
}
/**
* Returns {@code true} if this {@link WidgetItem} has the same type as the given
* {@code otherItem}.
*
* For example, both items are widgets or both items are shortcuts.
*/
public boolean hasSameType(WidgetItem otherItem) {
if (widgetInfo != null && otherItem.widgetInfo != null) {
return true;
}
if (activityInfo != null && otherItem.activityInfo != null) {
return true;
}
return false;
}
}