Skip to content

IntroductionBuilder

Ruben Gees edited this page Sep 17, 2015 · 7 revisions

Specific implementation details for the IntroductionBuilder

withSlides(List slides)

Add your Slides to the Builder. See the Wiki page for Slide to see how to implement a Slide.

withStyle(int style)

Specify the Style to use. There are currently 2 available Styles: Translucent and Fullscreen. Specify them like the following:

new IntroductionBuilder(this).withSlides(generateSlides())
                .withStyle(IntroductionBuilder.STYLE_FULLSCREEN).introduceMyself();

The default Style is Translucent.

withIndicatorManager(IndicatorManager manager)

Use a custom IndicatorManager. See the wiki page for a custom IndicatorManager to see how to implement one. Use it like the following:

new IntroductionBuilder(this).withSlides(generateSlides()).withIndicatorManager(new MyCustomIndicatorManager())
                .introduceMyself();

withPreviousButtonEnabled(boolean enabled)

Enable or disable the "previous"-Button. Note: It will be still possible to move backwards as the user still can scroll through the Slides.

withIndicatorEnabled(boolean enabled)

Enable or disable the Indicator. If disabled there will be no Indicator at the bottom, even if you specified a custom one.

withForcedOrientation(int orientation)

Force a Orientation, disabling the ability to rotate the Device. This is for design purposes. Available are portrait, landscape and both. The default is both.

withOnSlideChangedListener(IntroductionConfiguration.OnSlideChangedListener onSlideChangedListener)

Add a Listener that captures all moves through the Slides. The listener looks like the following:

new IntroductionBuilder(this).withSlides(generateSlides())
                .withOnSlideChangedListener(new IntroductionConfiguration.OnSlideChangedListener() {
                    @Override
                    public void onSlideChanged(int from, int to) {
                        //Do something here
                    }
                }).introduceMyself();

You can use this listener for various purposes. See the Runtime Permissions wiki page for an example.

withPageTransformer(ViewPager.PageTransformer pageTransformer)

Apply a custom PageTransformer to display cool animations. See the classes DepthPageTransformer and ZoomOutPageTransformer in the sample for working implementations.

introduceMyself()

Call this method if you did all of the configurations you wanted to finally start the Activity with your Slides.

Clone this wiki locally