Merge "Add SearchResultCode to onSearchResult()" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
30c1043b1c
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user