Merge "Removing ununsed append logic in search" into tm-dev am: 4adce848da
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18091362 Change-Id: I409328509af9345c8b5e2472f61ec8c15f481c16 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -192,27 +192,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean appendSearchResults(ArrayList<AdapterItem> results) {
|
||||
if (hasFilter() && results != null && results.size() > 0) {
|
||||
updateSearchAdapterItems(results, mSearchResults.size());
|
||||
refreshRecyclerView();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void updateSearchAdapterItems(ArrayList<AdapterItem> list, int offset) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AdapterItem adapterItem = list.get(i);
|
||||
adapterItem.position = offset + i;
|
||||
mAdapterItems.add(adapterItem);
|
||||
|
||||
if (adapterItem.isCountedForAccessibility()) {
|
||||
mAccessibilityResultsCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates internals when the set of apps are updated.
|
||||
*/
|
||||
@@ -282,7 +261,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
String lastSectionName = null;
|
||||
FastScrollSectionInfo lastFastScrollerSectionInfo = null;
|
||||
int position = 0;
|
||||
int appIndex = 0;
|
||||
|
||||
// Prepare to update the list of sections, filtered apps, etc.
|
||||
mAccessibilityResultsCount = 0;
|
||||
@@ -319,7 +297,16 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
mAdapterItems.add(appItem);
|
||||
}
|
||||
} else {
|
||||
updateSearchAdapterItems(mSearchResults, 0);
|
||||
int count = mSearchResults.size();
|
||||
for (int i = 0; i < count; i++) {
|
||||
AdapterItem adapterItem = mSearchResults.get(i);
|
||||
adapterItem.position = i;
|
||||
mAdapterItems.add(adapterItem);
|
||||
|
||||
if (adapterItem.isCountedForAccessibility()) {
|
||||
mAccessibilityResultsCount++;
|
||||
}
|
||||
}
|
||||
if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
|
||||
// Append the search market item
|
||||
if (hasNoFilteredResults()) {
|
||||
|
||||
@@ -176,14 +176,6 @@ public class AppsSearchContainerLayout extends ExtendedEditText
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppendSearchResult(String query, ArrayList<AdapterItem> items) {
|
||||
if (items != null) {
|
||||
mApps.appendSearchResults(items);
|
||||
notifyResultChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSearchResult() {
|
||||
if (mApps.setSearchResults(null)) {
|
||||
|
||||
@@ -31,13 +31,6 @@ public interface SearchCallback<T> {
|
||||
*/
|
||||
void onSearchResult(String query, ArrayList<T> items);
|
||||
|
||||
/**
|
||||
* Called when the search from secondary source is complete.
|
||||
*
|
||||
* @param items list of search results
|
||||
*/
|
||||
void onAppendSearchResult(String query, ArrayList<T> items);
|
||||
|
||||
/**
|
||||
* Called when the search results should be cleared.
|
||||
*/
|
||||
|
||||
@@ -94,11 +94,6 @@ public class WidgetsSearchBarController implements TextWatcher,
|
||||
mSearchModeListener.onSearchResults(items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppendSearchResult(String query, ArrayList<WidgetsListBaseEntry> items) {
|
||||
// Not needed.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSearchResult() {
|
||||
// Any existing search session will be cancelled by setting text to empty.
|
||||
|
||||
Reference in New Issue
Block a user