Fixing crash during rotation

am: bb702584fa

* commit 'bb702584fa551fab8cffbb0ae5459d9efd16ce2a':
  Fixing crash during rotation
This commit is contained in:
Sunny Goyal authored and android-build-merger committed 2016-02-11 22:58:20 +00:00
commit cb1edd20e1
3 files changed
+12 -5

No files matched your search

+2
View File
@@ -39,6 +39,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_content"
android:saveEnabled="false"
android:visibility="gone"
android:layout_gravity="center"
android:focusable="true"
@@ -60,6 +61,7 @@
<LinearLayout
android:id="@+id/search_container"
android:layout_width="match_parent"
android:saveEnabled="false"
android:layout_height="@dimen/all_apps_search_bar_height"
android:layout_gravity="start|top"
android:orientation="horizontal"
@@ -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();
@@ -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;
}
/**