diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-07-25 21:28:22 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-07-25 21:28:23 +0000 |
commit | 75df256cc14baf9e6b2d5f786cf06b56b0c800be (patch) | |
tree | 4906618b6384200a3a30c3634c381e13c6cdba4f /src/com/android/launcher3/allapps/AllAppsSearchBarController.java | |
parent | b0e80bcee7735589f5a11b1abc858acb6bf9d438 (diff) | |
parent | f66b6802392bc473d7e1f86a58cf65b25ed2148c (diff) | |
download | android_packages_apps_Trebuchet-75df256cc14baf9e6b2d5f786cf06b56b0c800be.tar.gz android_packages_apps_Trebuchet-75df256cc14baf9e6b2d5f786cf06b56b0c800be.tar.bz2 android_packages_apps_Trebuchet-75df256cc14baf9e6b2d5f786cf06b56b0c800be.zip |
Merge "Refresh the all apps container search result when apps are installed" into ub-launcher3-calgary
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsSearchBarController.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsSearchBarController.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java index ac3593238..e75210b93 100644 --- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java @@ -45,6 +45,7 @@ public abstract class AllAppsSearchBarController protected AlphabeticalAppsList mApps; protected Callbacks mCb; protected ExtendedEditText mInput; + private String mQuery; protected DefaultAppSearchAlgorithm mSearchAlgorithm; protected InputMethodManager mInputMethodManager; @@ -90,14 +91,23 @@ public abstract class AllAppsSearchBarController @Override public void afterTextChanged(final Editable s) { - String query = s.toString(); - if (query.isEmpty()) { + mQuery = s.toString(); + if (mQuery.isEmpty()) { mSearchAlgorithm.cancel(true); mCb.clearSearchResult(); } else { mSearchAlgorithm.cancel(false); - mSearchAlgorithm.doSearch(query, mCb); + mSearchAlgorithm.doSearch(mQuery, mCb); + } + } + + protected void refreshSearchResult() { + if (mQuery == null) { + return; } + // If play store continues auto updating an app, we want to show partial result. + mSearchAlgorithm.cancel(false); + mSearchAlgorithm.doSearch(mQuery, mCb); } @Override @@ -130,6 +140,7 @@ public abstract class AllAppsSearchBarController * Resets the search bar state. */ public void reset() { + mQuery = null; unfocusSearchField(); mCb.clearSearchResult(); mInput.setText(""); |