diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-02-11 22:58:20 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-02-11 22:58:20 +0000 |
commit | cb1edd20e1072ff00992c09ca99ab412e1252761 (patch) | |
tree | 87c4c7fa03415ef5921b166dacce78c3ba8abe41 /src | |
parent | 8390eb1197512f8047d059371ec72f3e7315fee3 (diff) | |
parent | bb702584fa551fab8cffbb0ae5459d9efd16ce2a (diff) | |
download | android_packages_apps_Trebuchet-cb1edd20e1072ff00992c09ca99ab412e1252761.tar.gz android_packages_apps_Trebuchet-cb1edd20e1072ff00992c09ca99ab412e1252761.tar.bz2 android_packages_apps_Trebuchet-cb1edd20e1072ff00992c09ca99ab412e1252761.zip |
Fixing crash during rotation
am: bb702584fa
* commit 'bb702584fa551fab8cffbb0ae5459d9efd16ce2a':
Fixing crash during rotation
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 10 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/AlphabeticalAppsList.java | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 6a9d91073..6acbca540 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -587,16 +587,18 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc @Override public void onSearchResult(String query, ArrayList<ComponentKey> apps) { if (apps != null) { - mApps.setOrderedFilter(apps); + if (mApps.setOrderedFilter(apps)) { + mAppsRecyclerView.onSearchResultsChanged(); + } mAdapter.setLastSearchQuery(query); - mAppsRecyclerView.onSearchResultsChanged(); } } @Override public void clearSearchResult() { - mApps.setOrderedFilter(null); - mAppsRecyclerView.onSearchResultsChanged(); + if (mApps.setOrderedFilter(null)) { + mAppsRecyclerView.onSearchResultsChanged(); + } // Clear the search query mSearchQueryBuilder.clear(); diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index cb989e58b..9d2fe54db 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -278,11 +278,14 @@ public class AlphabeticalAppsList { /** * Sets the sorted list of filtered components. */ - public void setOrderedFilter(ArrayList<ComponentKey> f) { + public boolean setOrderedFilter(ArrayList<ComponentKey> f) { if (mSearchResults != f) { + boolean same = mSearchResults != null && mSearchResults.equals(f); mSearchResults = f; updateAdapterItems(); + return !same; } + return false; } /** |