mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Rebind recycler views if launcher activity restarted
Bug: 185038312 Test: manual TL;DR;; What was attempted but was too much refactoring of the code. Failed attempt #1: try re triggering the search. This was not trivial as SearchSession object is yet created. Failed attempt #2: Restoring AdapterItems in AlphabeticalAppsList This meant AdapterItems class and also it's children had to extend Parceleable object. Ultimate fix: Original issue of dupe view id among slice and work recyclerview should be fixed. And restoring should just work. Change-Id: I1bddd6aa5bc736ade3b02f69aa947d64cfa467d6
This commit is contained in:
@@ -184,16 +184,19 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
} catch (Exception e) {
|
||||
Log.e("AllAppsContainerView", "restoreInstanceState viewId = 0", e);
|
||||
}
|
||||
|
||||
Bundle state = (Bundle) sparseArray.get(R.id.work_tab_state_id, null);
|
||||
if (state != null) {
|
||||
int currentPage = state.getInt(BUNDLE_KEY_CURRENT_PAGE, 0);
|
||||
if (currentPage != 0) {
|
||||
rebindAdapters(true);
|
||||
mViewPager.setCurrentPage(currentPage);
|
||||
rebindAdapters(true);
|
||||
} else {
|
||||
mSearchUiManager.resetSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
|
||||
|
||||
Reference in New Issue
Block a user