Merge "Add SearchResultCode to onSearchResult()" into tm-qpr-dev am: 30c1043b1c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20445922

Change-Id: I67353fe895e700890851cd007e6966ce1d8b9f70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Anushree Ganjam
2022-11-15 18:43:23 +00:00
committed by Automerger Merge Worker
2 changed files with 27 additions and 1 deletions
@@ -102,6 +102,16 @@ public class ActivityAllAppsContainerView<T extends Context & AppLauncher
}
}
/**
* Sets results list for search.
*
* @param searchResultCode indicates if the result is final or intermediate for a given query
* since we can get search results from multiple sources.
*/
public void setSearchResults(ArrayList<AdapterItem> results, int searchResultCode) {
setSearchResults(results);
}
private void animateToSearchState(boolean goingToSearch) {
animateToSearchState(goingToSearch, DEFAULT_SEARCH_TRANSITION_DURATION_MS);
}
@@ -311,7 +321,7 @@ public class ActivityAllAppsContainerView<T extends Context & AppLauncher
layoutParams.topMargin =
includeTabsMargin
? getContext().getResources().getDimensionPixelSize(
R.dimen.all_apps_header_pill_height)
R.dimen.all_apps_header_pill_height)
: 0;
}
@@ -24,6 +24,11 @@ import java.util.ArrayList;
*/
public interface SearchCallback<T> {
// Search Result Codes
int UNKNOWN = 0;
int INTERMEDIATE = 1;
int FINAL = 2;
/**
* Called when the search from primary source is complete.
*
@@ -31,6 +36,17 @@ public interface SearchCallback<T> {
*/
void onSearchResult(String query, ArrayList<T> items);
/**
* Called when the search from primary source is complete.
*
* @param items list of search results
* @param searchResultCode indicates if the result is final or intermediate for a given query
* since we can get search results from multiple sources.
*/
default void onSearchResult(String query, ArrayList<T> items, int searchResultCode) {
onSearchResult(query, items);
}
/**
* Called when the search results should be cleared.
*/