The ViewPager has 12 pages, 6 of them are called, for example, "123", the other 6 are called "ABC".
First, all 6 pages of "123" go, then the remaining 6 "ABC" pages.
I want that when turning over 1-5 pages, it was written "123" above and only when turning over from 6 pages to 7, the inscription smoothly changed to "ABC" and vice versa, and when turning over other pages, the inscriptions remained motionless.

How can I do that?

  • We need to get a smooth change of the names "123" and "ABC", which moves, as it were, with page 6 on page 7 - asurovenko

1 answer 1

You need to move your label outside of the ViewPager. For example, by placing a ViewPager and TextView labeled FrameLayout. So your inscription will not be scrolled along with the pages of the ViewPager. You can change the inscription itself in the ViewPager page-change listener callback - OnPageChangeListener