Skip to content

Commit

Permalink
add remove(data)
Browse files Browse the repository at this point in the history
  • Loading branch information
limuyang committed Jan 2, 2020
1 parent aab0b7b commit 414d6ae
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,14 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
notifyItemRangeChanged(internalPosition, this.data.size - internalPosition)
}

open fun remove(data: T) {
val index = this.data.indexOf(data)
if(index == -1) {
return
}
remove(index)
}

/**
* change data
* 改变数据
Expand Down

0 comments on commit 414d6ae

Please sign in to comment.