Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 3667c60

Browse files
authored
fix: TransactionTooLarge Exception caused by FragmentStateAdapter (#1850)
Previously, the FragmentStateAdapter was saving the state of the course dashboard view pager tabs upon navigation to the NavigationActivity. This behaviour resulted in a TransactionTooLarge Exception when attempting to save the state in the bundle. To mitigate this issue, we've made adjustments to the caching mechanism of the ViewPager2. Specifically, we've set the OffPage limit of the viewPager to ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT, which leverages the default caching mechanism of RecyclerView. This modification ensures efficient state handling and resolves the encountered exception. Fixes: LEARNER-9897
1 parent 89d8d4e commit 3667c60

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

OpenEdXMobile/src/main/java/org/edx/mobile/view/CourseTabsDashboardFragment.kt

-4
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,6 @@ class CourseTabsDashboardFragment : BaseFragment() {
519519
) { tab: TabLayout.Tab, position: Int ->
520520
tab.text = courseTabItems[position].title
521521
}.attach()
522-
523-
if (courseTabItems.size - 1 > 1) {
524-
binding.pager.offscreenPageLimit = courseTabItems.size - 1
525-
}
526522
}
527523

528524
private fun setupToolbar(hasAccess: Boolean) {

0 commit comments

Comments
 (0)