androidx.recyclerview.widget.ListUpdateCallback Java Examples
The following examples show how to use
androidx.recyclerview.widget.ListUpdateCallback.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DiffResult.java From epoxy with Apache License 2.0 | 5 votes |
public void dispatchTo(ListUpdateCallback callback) { if (differResult != null) { differResult.dispatchUpdatesTo(callback); } else if (newModels.isEmpty() && !previousModels.isEmpty()) { callback.onRemoved(0, previousModels.size()); } else if (!newModels.isEmpty() && previousModels.isEmpty()) { callback.onInserted(0, newModels.size()); } // Else nothing changed! }
Example #2
Source File: RendererRecyclerViewAdapter.java From RendererRecyclerViewAdapter with Apache License 2.0 | 4 votes |
public void setUpdateCallback(@NonNull final ListUpdateCallback updateCallback) { mUpdateCallback = updateCallback; }