Skip to content

Commit

Permalink
Merge pull request #1239 from FrankKwok/master
Browse files Browse the repository at this point in the history
add new method replaceData
  • Loading branch information
CymChad authored Jun 22, 2017
2 parents 896806d + dd0fbaa commit b773955
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,18 @@ public void addData(@NonNull Collection<? extends T> newData) {
compatibilityDataSizeChanged(newData.size());
}

/**
* use data to replace all item in mData. this method is different {@link #setNewData(List)},
* it doesn't change the mData reference
*
* @param data data collection
*/
public void replaceData(@NonNull Collection<? extends T> data) {
mData.clear();
mData.addAll(data);
notifyDataSetChanged();
}

/**
* compatible getLoadMoreViewCount and getEmptyViewCount may change
*
Expand Down

0 comments on commit b773955

Please sign in to comment.