Enable stable ids again
now we have stable ids, sorta
This commit is contained in:
parent
4295e5cf55
commit
6cc8277694
2 changed files with 23 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ class ThreadAdapter(
|
|||
|
||||
init {
|
||||
setupDragListener(true)
|
||||
setHasStableIds(true)
|
||||
}
|
||||
|
||||
override fun getActionMenuId() = R.menu.cab_thread
|
||||
|
|
@ -142,6 +143,13 @@ class ThreadAdapter(
|
|||
bindViewHolder(holder)
|
||||
}
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return when (val item = getItem(position)) {
|
||||
is Message -> Message.getStableId(item)
|
||||
else -> item.hashCode().toLong()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return when (val item = getItem(position)) {
|
||||
is ThreadLoading -> THREAD_LOADING
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue