Android - How to have multiple pages/section in a fragment? (No viewPager)

Viewed 22

For better Understanding check this sample design

Image

What I want to achieve is a sign up mechanism. Where when a user done filling page 1 and click next then

  • The next button stays at the fixed location
  • The indicator do an animation and change
  • The two field ("Full Name" and "Select your gender") get swapped out by the fields of Page 2.

Those fields in both pages will be in same Fragment, viewModel and repository. This is a simplified version of what I want to achieve.

I am a beginner in Android & already watched tutorials of viewPager2 but I'm pretty sure it won't help here. One thing I can do is, to use "visibility hide & show" but I don't think it would be the best practice. Hiding and showing will also not help in manually swapping the pages.

So, how to implement multiple pages/section in a single fragment?

0 Answers
Related