stepstone-tech / android-material-stepper

This library allows to use Material steppers inside Android applications.
Apache License 2.0
1.78k stars 261 forks source link

fragment created before get visible to user. #226

Closed mrzslr closed 6 years ago

mrzslr commented 6 years ago

hi there, I have an issue, I have 3 step fragment in StepAdapter. when the first fragment showed to the user, the next 2 fragment oncreateView called before I see. what's the problem?

zawadz88 commented 6 years ago

Hi, StepperLayout uses a ViewPager internally so it will always create the Fragments/Views next to the currently selected one.

zawadz88 commented 6 years ago

Hi @mohammadreza, Were you able to solve your issue?

shahimclt commented 6 years ago

@mohammadreza that is the intended behavior as the lib uses a ViewPager internally. If what you want is to run some code only when the step is visible to the user, you can put that code in StepFragment.onSelected(). Hope this helps.