From 375b3ec46ed3293f0d165bad4ba5540b3c61075e Mon Sep 17 00:00:00 2001 From: Osten <11805592+LagradOst@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:42:31 +0100 Subject: [PATCH] Update HomeParentItemAdapter.kt Should fix last item problem --- .../lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt index 50111428..03ec1a6c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeParentItemAdapter.kt @@ -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] -} \ No newline at end of file +}