mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +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:
@@ -20,10 +20,14 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
||||
import com.android.launcher3.model.WidgetItem;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.launcher3.widget.WidgetItemComparator;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** Holder class to store the package information of an entry shown in the widgets list. */
|
||||
public abstract class WidgetsListBaseEntry {
|
||||
@@ -35,9 +39,14 @@ public abstract class WidgetsListBaseEntry {
|
||||
*/
|
||||
public final String mTitleSectionName;
|
||||
|
||||
public WidgetsListBaseEntry(PackageItemInfo pkgItem, String titleSectionName) {
|
||||
public final List<WidgetItem> mWidgets;
|
||||
|
||||
public WidgetsListBaseEntry(PackageItemInfo pkgItem, String titleSectionName,
|
||||
List<WidgetItem> items) {
|
||||
mPkgItem = pkgItem;
|
||||
mTitleSectionName = titleSectionName;
|
||||
this.mWidgets =
|
||||
items.stream().sorted(new WidgetItemComparator()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user