Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create a Sequence? #79

Open
Arcdub opened this issue Dec 14, 2017 · 2 comments
Open

How do I create a Sequence? #79

Arcdub opened this issue Dec 14, 2017 · 2 comments

Comments

@Arcdub
Copy link

Arcdub commented Dec 14, 2017

As the title asks, how exactly do I create a sequence of Intros to be shown? I didn't get a clear indication on how to do it from the code examples given.

@jlurena
Copy link

jlurena commented Aug 26, 2018

I figured it out.
Just follow these steps:

  1. Create all the builders in Stack order. So the first MaterialIntroView should be the last initialized one.
  2. Set a listener to each that triggers the next MaterialIntroView.

EG:

// Last
final MaterialIntroView.Builder intro3 = new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(100)
    .setTarget(view3)
    .setInfoText("Some direction");
    .setUsageId("view3") // IMPORTANT

// Second
final MaterialIntroView.Builder intro2 = new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(100)
    .setTarget(view2)
    .setInfoText("Some info")
    .setUsageId("view2") // IMPORTANT
    .setListener(s -> intro3.show()); // IMPORTANT

// First
new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(500)
    .setTarget(view1)
    .setInfoText("Some info")
    .setUsageId("view1") // IMPORTANT
    .setListener(s -> intro2.show()) // IMPORTANT
    .show();

@das1192
Copy link

das1192 commented Jan 23, 2021

I figured it out.
Just follow these steps:

1. Create all the builders in Stack order. So the first MaterialIntroView should be the last initialized one.

2. Set a listener to each that triggers the next MaterialIntroView.

EG:

// Last
final MaterialIntroView.Builder intro3 = new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(100)
    .setTarget(view3)
    .setInfoText("Some direction");
    .setUsageId("view3") // IMPORTANT

// Second
final MaterialIntroView.Builder intro2 = new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(100)
    .setTarget(view2)
    .setInfoText("Some info")
    .setUsageId("view2") // IMPORTANT
    .setListener(s -> intro3.show()); // IMPORTANT

// First
new MaterialIntroView.Builder(this)
    .setFocusType(Focus.ALL)
    .setDelayMillis(500)
    .setTarget(view1)
    .setInfoText("Some info")
    .setUsageId("view1") // IMPORTANT
    .setListener(s -> intro2.show()) // IMPORTANT
    .show();

Thanks buddy its working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants