Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
limuyang committed Jan 2, 2020
1 parent 607c0aa commit eef6acf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,12 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
return data.getOrNull(position)
}

internal fun getItemPosition(item: T?): Int {
/**
* 如果返回 -1,表示不存在
* @param item T?
* @return Int
*/
fun getItemPosition(item: T?): Int {
return if (item != null && data.isNotEmpty()) data.indexOf(item) else -1
}

Expand Down

0 comments on commit eef6acf

Please sign in to comment.