mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Fix: Over-reload on expanding description (Closes #138)
Fix: Wrong Appearing and Disappearing order in Releases
This commit is contained in:
parent
7fbb6fedaf
commit
9980582340
@ -972,35 +972,24 @@ 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(
|
notifyItemRangeChanged(position - 1, position)
|
||||||
position - expandItem.items.size,
|
|
||||||
expandItem.items.size
|
|
||||||
)
|
|
||||||
notifyItemChanged(position, Payload.REFRESH)
|
|
||||||
} else {
|
} else {
|
||||||
items.addAll(position, expandItem.items)
|
items.addAll(position, expandItem.items)
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
// Update decorations
|
notifyItemInserted(position)
|
||||||
notifyItemChanged(position - 1, Payload.REFRESH)
|
notifyItemChanged(position)
|
||||||
}
|
}
|
||||||
notifyItemChanged(position, Payload.REFRESH)
|
|
||||||
notifyItemRangeInserted(position, expandItem.items.size)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
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(
|
notifyItemRangeChanged(position - 1, position)
|
||||||
position - expandItem.items.size,
|
|
||||||
expandItem.items.size
|
|
||||||
)
|
|
||||||
notifyItemChanged(position, Payload.REFRESH)
|
|
||||||
} else {
|
} else {
|
||||||
items.removeAt(position - 1)
|
items.removeAt(position - 1)
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
// Update decorations
|
|
||||||
notifyItemRemoved(position - 1)
|
notifyItemRemoved(position - 1)
|
||||||
notifyItemChanged(position - 1, Payload.REFRESH)
|
notifyItemChanged(position)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user