I'm doing some prototyping for my second app which will be using a TabLayout and ViewPager to display a series of 4 pages in a specific order so that the user can do a task in a logical manner. I will need to make sure that the user doesn't jump from an early page to a later page until the work on the early page is completed. Is that even possible in a TabLayout/ViewPager app?
All the examples I have seen so far demonstrate three tabs and show the user swiping effortlessly from one to the next and back again. None of the examples even HINT that it's possible to prevent swiping (or tabbing) to one of the other pages until a given condition is met. I need to understand if it's even POSSIBLE to limit swiping/tabbing in an app like this.
I would like the user to finish the "work" on the first page and then signal that he/she is done by clicking a NEXT button. The user should NOT be able to proceed to another page unless NEXT has been pressed. (The NEXT button is essentially the user's way of telling the app that he's finished with the first page.) By the same token, if a user is on one of the later pages, I don't want him to be able to go back to a prior page in most pages: I want to write program logic that decides if it's okay to take him back to a previous page based on what has happened so far.
Can I do what I'm proposing in Android Studio 3.1.4? If yes, what are the main classes/methods I will use to control the swiping and tabbing?
If this is NOT possible in Android, approach SHOULD I use to build my app?