Potentially fix 'design assumption violated' ISE.

This commit is contained in:
Greyson Parrelli
2024-06-05 11:06:00 -04:00
committed by Cody Henthorne
parent fd00ed71b5
commit 54656ea14e

View File

@@ -35,6 +35,10 @@ class StoryViewerPagerAdapter(
return pages[position].toLong()
}
override fun containsItem(itemId: Long): Boolean {
return pages.find { it.toLong() == itemId } != null
}
override fun createFragment(position: Int): Fragment {
return StoryViewerPageFragment.create(arguments.copy(recipientId = pages[position]))
}