I have a ViewPager and 12 pages on it. 6 belong to one group and 6 to another. How to divide pages into groups so beautifully? Is it possible to put another text on top, which when turning 1-5 pages will not turn over. And when turning over from 6 to 7 pages, he also turned over, informing that a group of pages had changed.

    1 answer 1

    You put the textview over the entire width over the tabs and when you have a fragment from 5 to 6 change to change the text in this textview. You can always find out the page number in the onPageSelected method.

    • But then it will not be beautiful ... Just a sharp change in the text, I would like it to be animated along with the page changed. - Alexey
    • @ Alexey, you probably will not be able to leave comments under the answer, so here's a chat for you. - Nick Volynkin
    • Well, that's another question. Look then in the direction of ObjectAnimator - pavel163