Last active
August 29, 2015 14:22
-
-
Save kmdupr33/8463779414c88a93f245 to your computer and use it in GitHub Desktop.
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
public class RecyclerView { | |
private void setAdapterInternal(Adapter adapter, boolean compatibleWithPrevious, | |
boolean removeAndRecycleViews) { | |
if (mAdapter != null) { | |
mAdapter.unregisterAdapterDataObserver(mObserver); | |
} | |
//... | |
mAdapter = adapter; | |
if (adapter != null) { | |
//mObserver responds to changes in the Adapter's data by helping the RecyclerView redraw itself appropriately. | |
adapter.registerAdapterDataObserver(mObserver); | |
} | |
if (mLayout != null) { | |
mLayout.onAdapterChanged(oldAdapter, mAdapter); | |
} | |
mRecycler.onAdapterChanged(oldAdapter, mAdapter, compatibleWithPrevious); | |
mState.mStructureChanged = true; | |
markKnownViewsInvalid(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
removeAndRecycleViews isn't used?