mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Introduce support for play results in launcher
Introduces PluginSearchPipeline class, a plugin listener for AllAppsSearchPlugin. Coverts from List<Bundle> results from callback to AdapterItems to be rendered in SearchController. - Moves AdapterItem to AllAppsGridAdapter Bug: 164699827 Test: Manual Change-Id: I20ec147e6b3f4707cf69d62b4b4ac70a90196345
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.allapps.AllAppsGridAdapter.AdapterItem;
|
||||
import static com.android.launcher3.allapps.AllAppsGridAdapter.AdapterItemWithPayload;
|
||||
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_HAS_SHORTCUT_PERMISSION;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_CHANGE_PERMISSION;
|
||||
@@ -527,6 +529,25 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
return mViewPager == null ? getActiveRecyclerView() : mViewPager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles selection on focused view and returns success
|
||||
*/
|
||||
public boolean selectFocusedView(View v) {
|
||||
ItemInfo itemInfo = getHighlightedItemInfo();
|
||||
if (itemInfo != null) {
|
||||
return mLauncher.startActivitySafely(v, itemInfo.getIntent(), itemInfo);
|
||||
}
|
||||
AdapterItem focusedItem = getActiveRecyclerView().getApps().getFocusedChild();
|
||||
if (focusedItem instanceof AdapterItemWithPayload) {
|
||||
Runnable onSelection = ((AdapterItemWithPayload) focusedItem).getSelectionHandler();
|
||||
if (onSelection != null) {
|
||||
onSelection.run();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ItemInfo of a view that is in focus, ready to be launched by an IME.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user