Моя проблема возникает, когда я устанавливаю notifyItemChange в recycleView, просматриваю в NestedscrollView автоматическую прокрутку вверх, он не сохраняет позицию
Это мой кодXML
Код: Выделить всё
//other code
Код: Выделить всё
val linearLayoutManager = GridLayoutManager(context, 3, LinearLayoutManager.VERTICAL, false)
mBinding.rvQrBackground.apply {
adapter = qrBackgroundAdapter
layoutManager = linearLayoutManager
}
Код: Выделить всё
root.setThrottleClickListener {
if (selectedItem != position) {
val oldPosition = selectedItem
selectedItem = position
notifyItemChanged(oldPosition)
notifyItemChanged(position)
}
onItemClickListener?.invoke(this, position)
}
Код: Выделить всё
android:descendantFocusability="blocksDescendants"
Подробнее здесь: https://stackoverflow.com/questions/783 ... cycle-view