mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Adding market search.
Change-Id: Id41615653cd4fa76213add4595418ad0cc6e7852
This commit is contained in:
@@ -169,19 +169,21 @@ final class DefaultAppSearchController extends AllAppsSearchBarController
|
||||
if (actionId != EditorInfo.IME_ACTION_DONE) {
|
||||
return false;
|
||||
}
|
||||
// Skip if there isn't exactly one item
|
||||
if (mApps.getSize() != 1) {
|
||||
// Skip if there are more than one icon
|
||||
if (mApps.getNumFilteredApps() > 1) {
|
||||
return false;
|
||||
}
|
||||
// If there is exactly one icon, then quick-launch it
|
||||
// Otherwise, find the first icon, or fallback to the search-market-view and launch it
|
||||
List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
AlphabeticalAppsList.AdapterItem item = items.get(i);
|
||||
if (item.viewType == AllAppsGridAdapter.ICON_VIEW_TYPE) {
|
||||
mAppsRecyclerView.getChildAt(i).performClick();
|
||||
mInputMethodManager.hideSoftInputFromWindow(
|
||||
mContainerView.getWindowToken(), 0);
|
||||
return true;
|
||||
switch (item.viewType) {
|
||||
case AllAppsGridAdapter.ICON_VIEW_TYPE:
|
||||
case AllAppsGridAdapter.SEARCH_MARKET_VIEW_TYPE:
|
||||
mAppsRecyclerView.getChildAt(i).performClick();
|
||||
mInputMethodManager.hideSoftInputFromWindow(
|
||||
mContainerView.getWindowToken(), 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user