Last active
July 19, 2017 09:44
-
-
Save bouhady/51b946f33744f005f28d59d9d020d28a to your computer and use it in GitHub Desktop.
This action should be called before and after each RecycleView update (NotifyDataChanged/Remove..)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Action1<Boolean> rxRecycleSync = new Action1<Boolean>() { | |
Parcelable parcelable = null; | |
@Override | |
public void call(Boolean saveState) { | |
if (saveState) | |
parcelable = recyclerView.getLayoutManager().onSaveInstanceState(); | |
else | |
recyclerView.getLayoutManager().onRestoreInstanceState(parcelable); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment