private void doRestoreState(Adapter adapter) { if (stateRestored || adapter == null || adapter.getItemCount() == 0) return; stateRestored = true; if (delayedState != null) { super.onRestoreInstanceState(delayedState); delayedState = null; } }
@Override public void onRestoreInstanceState(Parcelable state) { SavedState ss = (SavedState) state; mPrevFirstVisiblePosition = ss.prevFirstVisiblePosition; mPrevFirstVisibleChildHeight = ss.prevFirstVisibleChildHeight; mPrevScrolledChildrenHeight = ss.prevScrolledChildrenHeight; mPrevScrollY = ss.prevScrollY; mScrollY = ss.scrollY; mChildrenHeights = ss.childrenHeights; super.onRestoreInstanceState(ss.getSuperState()); }
@CallSuper @Override protected void onRestoreInstanceState(Parcelable state) { delayedState = state; super.onRestoreInstanceState(state); }