stepstone-tech / android-material-stepper

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

Ability to customize the library to add swipe functionality in welcome page case #235

Closed Phessami closed 6 years ago

Phessami commented 6 years ago

Hi First of all I want to thank you for this great library.

I tried extending some of the classes like StepViewPager and StepperLayout to add swipe functionality and I just notices that all of the classes in this library are @RestrictTo(LIBRARY) so that I'm unable to do what I need. The reason I need swipe is for creating a welcome page like https://android-arsenal.com/details/3/1997 utilizing this library along side with other good uses that it has.

zawadz88 commented 6 years ago

Hi @Phessami, StepViewPager and other widgets in this package are actually intentionally hidden as they are internal details. The only public View should be StepperLayout. Swiping is also disabled on purpose as this would break the step verification we have in the library.

In general, I'd say that library is not really meant for welcome screens like the one you referenced, but rather for steps which require some action.

You can however accomplish what you want by forking this library and re-enabling swiping in NonSwipeableViewPager and removing

mPager.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                return true;
            }
        });

from StepperLayout#init()