getItemPosition

open fun getItemPosition(@NonNull object: Any): Int(source)

Called when the host view is attempting to determine if an item's position has changed. Returns POSITION_UNCHANGED if the position of the given item has not changed or POSITION_NONE if the item is no longer present in the adapter.

The default implementation assumes that items will never change position and always returns POSITION_UNCHANGED.

Return

object's new position index from [0, getCount), POSITION_UNCHANGED if the object's position has not changed, or POSITION_NONE if the item is no longer present.

Parameters

object

Object representing an item, previously returned by a call to instantiateItem.