Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30c1043b authored by Anushree Ganjam's avatar Anushree Ganjam Committed by Android (Google) Code Review
Browse files

Merge "Add SearchResultCode to onSearchResult()" into tm-qpr-dev

parents ab61359a 60240139
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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);
    }
+16 −0
Original line number Diff line number Diff line
@@ -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.
     */