Add notifyItemRangeChanged to help recyclerview.
This commit is contained in:
parent
b7f641515a
commit
77cfcf202f
1 changed files with 4 additions and 2 deletions
|
@ -159,8 +159,9 @@ class TracklistAdapter(private val fragment: Fragment) : RecyclerView.Adapter<Re
|
||||||
// wait for result and store in tracklist
|
// wait for result and store in tracklist
|
||||||
withContext(Main) {
|
withContext(Main) {
|
||||||
tracklist = deferred.await()
|
tracklist = deferred.await()
|
||||||
notifyItemRemoved(position)
|
|
||||||
notifyItemChanged(0)
|
notifyItemChanged(0)
|
||||||
|
notifyItemRemoved(position)
|
||||||
|
notifyItemRangeChanged(position, tracklist.tracklistElements.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,8 +178,9 @@ class TracklistAdapter(private val fragment: Fragment) : RecyclerView.Adapter<Re
|
||||||
withContext(Main) {
|
withContext(Main) {
|
||||||
tracklist = deferred.await()
|
tracklist = deferred.await()
|
||||||
val positionInRecyclerView: Int = positionInTracklist + 1 // position 0 is the statistics element
|
val positionInRecyclerView: Int = positionInTracklist + 1 // position 0 is the statistics element
|
||||||
notifyItemRemoved(positionInRecyclerView)
|
|
||||||
notifyItemChanged(0)
|
notifyItemChanged(0)
|
||||||
|
notifyItemRemoved(positionInRecyclerView)
|
||||||
|
notifyItemRangeChanged(position, tracklist.tracklistElements.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue