Update HomeParentItemAdapter.kt

Should fix last item problem
This commit is contained in:
Osten 2024-03-17 16:42:31 +01:00 committed by GitHub
parent ad67b9ddab
commit 375b3ec46e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ open class ParentItemAdapter(
open fun onSaveInstanceState(outState: Bundle, recyclerView: RecyclerView? = null) {
if (recyclerView != null) {
for (position in items.indices) {
for (position in 0..itemCount) {
val holder = recyclerView.findViewHolderForAdapterPosition(position) ?: continue
saveHolder(holder)
}
@ -329,4 +329,4 @@ class SearchDiffCallback(
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
oldList[oldItemPosition] == newList[newItemPosition]
}
}