MaterialIntroView icon indicating copy to clipboard operation
MaterialIntroView copied to clipboard

How do I create a Sequence?

Open Arcdub opened this issue 8 years ago • 2 comments

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.

Arcdub avatar Dec 14 '17 23:12 Arcdub

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();

jlurena avatar Aug 26 '18 14:08 jlurena

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

das1192 avatar Jan 23 '21 12:01 das1192