Have a recycler view to show search results.

-Have a recycler view layout for search widgets list.
-Make WidgetsFullSheet implement interface- SearchModeListener to get notified when user is using search and also when search results are ready.
-Have a WidgetsListSearchHeaderViewHolderBinder for search result headers which shows subtext in header as concatenated string of widget/shortcut labels.
-Modify WidgetsListAdapter and WidgetsDiffReporter to work well with search recycler view.

Test: Tested prototype locally. Also added robolectric test.
Bug: b/157286785
Change-Id: Ie29d9f295fddb6d727b5fc26a360f514f2f4a763
This commit is contained in:
Alina Zaidi
2021-03-11 16:10:27 +00:00
parent 24a63bacd6
commit 334e65935b
21 changed files with 698 additions and 68 deletions

View File

@@ -51,10 +51,11 @@ public abstract class WidgetsListBaseEntry {
public abstract int getRank();
@Retention(SOURCE)
@IntDef({RANK_WIDGETS_LIST_HEADER, RANK_WIDGETS_LIST_CONTENT})
@IntDef({RANK_WIDGETS_LIST_HEADER, RANK_WIDGETS_LIST_SEARCH_HEADER, RANK_WIDGETS_LIST_CONTENT})
public @interface Rank {
}
public static final int RANK_WIDGETS_LIST_HEADER = 1;
public static final int RANK_WIDGETS_LIST_CONTENT = 2;
public static final int RANK_WIDGETS_LIST_SEARCH_HEADER = 2;
public static final int RANK_WIDGETS_LIST_CONTENT = 3;
}