mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Fixing search behavior in Launcher3
> Showing no-result found only when there are no results > Removing unnecessary view inflation in RecyclerViewPool for various search vide types > Removing unused market-search link and no-empty-result illustration Bug: 240343082 Bug: 207573083 Test: Verified Launcher3 Change-Id: Ia44799cd2385ea5dc837ef25732ca237975abde7
This commit is contained in:
@@ -15,17 +15,12 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_ALL_APPS_DIVIDER;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_SEARCH_MARKET;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.LabelComparator;
|
||||
@@ -172,13 +167,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
return !mSearchResults.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether there are no filtered results.
|
||||
*/
|
||||
public boolean hasNoFilteredResults() {
|
||||
return hasSearchResults() && mAccessibilityResultsCount == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets results list for search
|
||||
*/
|
||||
@@ -249,15 +237,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
// ordered set of sections
|
||||
if (hasSearchResults()) {
|
||||
mAdapterItems.addAll(mSearchResults);
|
||||
if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
|
||||
// Append the search market item
|
||||
if (hasNoFilteredResults()) {
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_EMPTY_SEARCH));
|
||||
} else {
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_ALL_APPS_DIVIDER));
|
||||
}
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_SEARCH_MARKET));
|
||||
}
|
||||
} else {
|
||||
int position = 0;
|
||||
if (mWorkProviderManager != null) {
|
||||
|
||||
Reference in New Issue
Block a user