Open Ankur008 opened 7 years ago
For some reason, there doesn't seem to be an actual sequence listener, but you can sort of reconstruct the sequence like this:
SpotlightView slideOne = new SpotlightView.Builder(activity)
.target(firstView)
.setConfiguration(mConfig)
.headingTvText("Example")
.subHeadingTvText("Example")
.usageId(ID_STRING_1)
.show();
final SpotlightView.Builder menu = new SpotlightView.Builder(activity)
.target(secondView)
.setConfiguration(mConfig)
.headingTvText("Example")
.subHeadingTvText("Example")
.usageId(ID_STRING_2);
SpotlightListener listener = new SpotlightListener()
{
@Override
public void onUserClicked(String s)
{
switch (s) {
case ID_STRING_1:
menu.show();
break;
case ID_STRING_2:
break;
}
}
};
drawer.setListener(listener);
menu.setListener(listener);
The onUserClicked()
function will execute whe the slide is disappearing. To set an action for the end of the tutorial, just add a case in the switch for the ID of your last slide.
In my case, I am showing multiple screen using the SpotlightSequence,
SpotlightSequence.getInstance(MainActivity.this, null) .addSpotlight(profile_pic, "Edit Profile", "Change your profile pic & Edit profile info", INTRO_PROFILE + randomChar) .addSpotlight(bpBlock.leftImage, "Add BP reading ", "You can add BP readings here", INTRO_ADDBP + randomChar) .startSequence();
here how can I add the listener in the sequence?
@Ankur008 , @zacharee , Added a listener for that. Please check the fix here #71 .
I want to run a function when the tour is complete. How would I do it?