material-intro-screen icon indicating copy to clipboard operation
material-intro-screen copied to clipboard

Go to next slide by code

Open am2222 opened this issue 9 years ago • 7 comments

Hi, Is there any way to go to next slide by code in a custom slide?

am2222 avatar Oct 27 '16 19:10 am2222

Currently no.

bezmian avatar Oct 28 '16 09:10 bezmian

There is a work around to go to a next slide by code through simulating a key press. You can do this from your activity that extends MaterialIntroActivity:

dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_DPAD_RIGHT));

brownpixel avatar Dec 21 '16 12:12 brownpixel

You can also call onKeyDown of MaterialIntroActivity directly with KEYCODE_DPAD_RIGHT

aviadmini avatar Jan 11 '17 19:01 aviadmini

I believe this is a good feature to implement on a future release.

Mauker1 avatar Feb 13 '17 18:02 Mauker1

@brownpixel Hi, What about going to next slide by code in current SlideFragment.It seems it does not have any solutions

am2222 avatar Feb 21 '17 09:02 am2222

Hi @am2222, Try this code in Activity, that extends MaterialIntroActivity findViewById(R.id.button_next).performClick(); It work for me fine.

luck-alex13 avatar Apr 24 '18 02:04 luck-alex13

Even more so I'd like to move to the next page when the previous permission was granted. And this library just makes that so hard! Ah that would've been obvious and straightforward had i chosen to code it myself and not use a library :(

crearo avatar Jul 23 '19 07:07 crearo