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

View file

@ -72,7 +72,7 @@ open class ParentItemAdapter(
open fun onSaveInstanceState(outState: Bundle, recyclerView: RecyclerView? = null) { open fun onSaveInstanceState(outState: Bundle, recyclerView: RecyclerView? = null) {
if (recyclerView != null) { if (recyclerView != null) {
for (position in items.indices) { for (position in 0..itemCount) {
val holder = recyclerView.findViewHolderForAdapterPosition(position) ?: continue val holder = recyclerView.findViewHolderForAdapterPosition(position) ?: continue
saveHolder(holder) saveHolder(holder)
} }