mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +00:00
Improve: Optimize Reload method (AppDetailAdapter)
This commit is contained in:
parent
b96c6a9e64
commit
ebb77ffa71
@ -888,7 +888,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) :
|
|||||||
val from = items.indexOfFirst { it is Item.ReleaseItem }
|
val from = items.indexOfFirst { it is Item.ReleaseItem }
|
||||||
val to = items.indexOfLast { it is Item.ReleaseItem }
|
val to = items.indexOfLast { it is Item.ReleaseItem }
|
||||||
if (from in 0..to) {
|
if (from in 0..to) {
|
||||||
notifyItemRangeChanged(0, 1)
|
notifyItemRangeChanged(from, to - from)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
notifyItemChanged(index, Payload.STATUS)
|
notifyItemChanged(index, Payload.STATUS)
|
||||||
@ -972,7 +972,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) :
|
|||||||
expanded += expandItem.expandType
|
expanded += expandItem.expandType
|
||||||
if (expandItem.replace) {
|
if (expandItem.replace) {
|
||||||
items[position - 1] = expandItem.items[0]
|
items[position - 1] = expandItem.items[0]
|
||||||
notifyItemRangeChanged(position - 1, position)
|
notifyItemRangeChanged(position - 1, 2)
|
||||||
} else {
|
} else {
|
||||||
items.addAll(position, expandItem.items)
|
items.addAll(position, expandItem.items)
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
@ -984,7 +984,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) :
|
|||||||
expanded -= expandItem.expandType
|
expanded -= expandItem.expandType
|
||||||
if (expandItem.replace) {
|
if (expandItem.replace) {
|
||||||
items[position - 1] = expandItem.items[1]
|
items[position - 1] = expandItem.items[1]
|
||||||
notifyItemRangeChanged(position - 1, position)
|
notifyItemRangeChanged(position - 1, 2)
|
||||||
} else {
|
} else {
|
||||||
items.removeAt(position - 1)
|
items.removeAt(position - 1)
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user