I have viewPager with 2 fragments of user complete profile, what my problem is I dont want to let the user to swipe the second fragment of my view pager unless user completes the first profile fragment. My aim is user must fill the first profile fragment and click confirm button then my view pager will swipe the second fragment.
Asked
Active
Viewed 141 times
0
-
1Possible duplicate of [How do disable paging by swiping with finger in ViewPager but still be able to swipe programmatically?](https://stackoverflow.com/questions/9650265/how-do-disable-paging-by-swiping-with-finger-in-viewpager-but-still-be-able-to-s) – Alex Mar 09 '18 at 08:15
-
2Possible duplicate of [Is it possible to disable scrolling on a ViewPager](https://stackoverflow.com/questions/7814017/is-it-possible-to-disable-scrolling-on-a-viewpager) – leonardkraemer Mar 09 '18 at 08:15
-
try https://stackoverflow.com/a/7814054/8089770 – Vidhi Dave Mar 09 '18 at 08:17
-
I just use Fragment pager adapter, plz can someone help me? – KyawLinnThant Mar 09 '18 at 09:01
2 Answers
0
You can use StepperView for your purpose. Kindly go through this library. You can add a form validation on button on first page, if validation satisfies, then step into next step. Android Material Stepper

Insane Developer
- 1,014
- 10
- 19
0
you can use this link https://stackoverflow.com/a/9650884/6549856 can create custom ViewPager
which will disable swipe gestures and after it, you can make call to your second fragment as
btn_confirm.setOnClickListener(new View.OnClickListener{
@Override
public void onClick(View v){
viewPager.setCurrentItem(1,true);
}
});

Chintak Patel
- 748
- 6
- 24