Closed HamzaIsrar12 closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 1.07%. Comparing base (
89d8d4e
) to head (7bfe8a7
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@HamzaIsrar12 plz correct me if I'm wrong, we're currently saving data of 2 pages at any time other than the currently visible right?
if yes, how will the change you've made solve this problem? does it mean that no other page would be pre-loaded after this change?
@miankhalid Previously, we ensured that all 6 pages were constantly retained on the course dashboard.
However, with the recent change, RecyclerView's mechanism ensures that all pages—both visible and some preceding and subsequent pages—are preloaded. Through observation, it's apparent that RecyclerView's retention mechanism excels over ViewPager's, effectively optimizing resource utilization without exceeding transaction limits.
In short, the UX behaviour remains unchanged. 🏎️
Description
LEARNER-9897
Previously, the
FragmentStateAdapter
was saving the state of the course dashboard view pager tabs upon navigation to theNavigationActivity
. This behavior resulted in aTransactionTooLarge 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 toViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
, which leverages the default caching mechanism ofRecyclerView
. This modification ensures efficient state handling and resolves the encountered exception.