1

We recently migrated from ViewPager to ViewPager2. Everything was pretty straight forward but we've noticed that randomly, when switching pages, the page being scrolled resizes down and stays that size until you interact with the page.

We have no customization on the viewpager2:

<androidx.viewpager2.widget.ViewPager2
    android:id="@+id/viewPager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

We're also setting no page transitions after instantiating.

The content that's resizing is a PhotoView (https://github.com/chrisbanes/PhotoView). Nothing inside the photoview has changed

Has anyone else run into this before?

Here's a simple visual:

Viewpager2 size before scroll Viewpager2 size during/after scroll

Psest328
  • 6,575
  • 11
  • 55
  • 90
  • Have you found the solution. Please suggest the solution – mukesh Jul 13 '20 at 13:45
  • 1
    @mukesh unfortunately not. We ended up using Glide to display the image in PhotoView. It worked but it bypassed the issue rather than fixed it as we needed to do page customizations that ended up having to be hacked together after glide finished – Psest328 Jul 15 '20 at 16:13

0 Answers0