I am working on music app which has songs queue contains duplicate songs (as per user's requirement to repeat the song) with different state , one of them could be in playing state or others not(screenshot).
I have set
Код: Выделить всё
setHasStableIds(true)
Код: Выделить всё
getItemId
Код: Выделить всё
override fun getItemId(position: Int): Long { return dataset[position].songId.hashCode().toLong() }
Код: Выделить всё
Song
Код: Выделить всё
data class QueueSong(private val song: Song) : Song(song) { val queueId: Int = hashCode() }
Источник: https://stackoverflow.com/questions/781 ... ame-stable