mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Add a WidgetsSearchBar(Launcher3) and a WidgetsSearchController.
- Make WidgetsSearchBar in Launcher3 initialize WidgetsSearchController with SimpleWidgetsSearchPipeline - Modify SimpleWidgetsSearchPipeline to filter widgets entries on widgets/shortcut labels also. Test: Tested prototype locally. Also added robolectric test. Bug: b/157286785 Change-Id: I65f5fa0240ffb6d22023167e4e86d94d83bbd9f7
This commit is contained in:
@@ -17,23 +17,18 @@ package com.android.launcher3.widget.model;
|
||||
|
||||
import com.android.launcher3.model.WidgetItem;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.launcher3.widget.WidgetItemComparator;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** An information holder for an app which has widgets or/and shortcuts, to be shown in search. */
|
||||
public final class WidgetsListSearchHeaderEntry extends WidgetsListBaseEntry {
|
||||
|
||||
public final List<WidgetItem> mWidgets;
|
||||
|
||||
private boolean mIsWidgetListShown = false;
|
||||
private boolean mHasEntryUpdated = false;
|
||||
|
||||
public WidgetsListSearchHeaderEntry(PackageItemInfo pkgItem, String titleSectionName,
|
||||
List<WidgetItem> items) {
|
||||
super(pkgItem, titleSectionName);
|
||||
mWidgets = items.stream().sorted(new WidgetItemComparator()).collect(Collectors.toList());
|
||||
super(pkgItem, titleSectionName, items);
|
||||
}
|
||||
|
||||
/** Sets if the widgets list associated with this header is shown. */
|
||||
|
||||
Reference in New Issue
Block a user