Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
youlookwhat committed Jan 13, 2020
1 parent 9d39703 commit 7b29e95
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public void setRecyclerView(ByRecyclerView recyclerView) {
mRecyclerView = recyclerView;
}

/**
* 在指定位置添加一条数据
*/
public void addData(int position, T data) {
mData.add(position, data);
notifyItemRangeInserted(position + getCustomTopItemViewCount(), 1);
Expand Down Expand Up @@ -93,6 +96,9 @@ public void addData(List<T> data) {
compatibilityDataSizeChanged(data.size());
}

/**
* 在指定位置添加一组数据
*/
public void addData(int position, List<T> data) {
this.mData.addAll(position, data);
notifyItemRangeInserted(position + getCustomTopItemViewCount(), data.size());
Expand Down

0 comments on commit 7b29e95

Please sign in to comment.