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

Impossible to chain MaterialTapTargetPrompt #6

Closed
kndtime opened this issue Aug 30, 2016 · 1 comment
Closed

Impossible to chain MaterialTapTargetPrompt #6

kndtime opened this issue Aug 30, 2016 · 1 comment

Comments

@kndtime
Copy link

kndtime commented Aug 30, 2016

Hey,

First of all awesome library! It's basically what I was looking for!!

On the other hand, I am trying to make multiple MaterialTapTargetPrompt showing up one after the other using MaterialTapTargetPrompt.show(); in onHidePromptComplete but it does nothing.

It's a known bug or am I doing it wrong?

@sjwall
Copy link
Owner

sjwall commented Aug 30, 2016

Hi,

Great to hear the library is just what you wanted.

It should be possible to create a new prompt in the onHidePromptComplete method.
There is currently no support for reusing a prompt.

The example below creates a second prompt after the first is removed from view, hopefully this solves the issue:

new MaterialTapTargetPrompt.Builder(MainActivity.this)
                .setTarget(findViewById(R.id.fab))
                .setPrimaryText("Send your first email")
                .setSecondaryText("Tap the envelop to start composing your first email")
                .setAnimationInterpolator(new FastOutSlowInInterpolator())
                .setOnHidePromptListener(new MaterialTapTargetPrompt.OnHidePromptListener()
                {
                    @Override
                    public void onHidePrompt(MotionEvent event, boolean tappedTarget)
                    {
                    }

                    @Override
                    public void onHidePromptComplete()
                    {
                        new MaterialTapTargetPrompt.Builder(MainActivity.this)
                                      .setTarget(findViewById(R.id.fab))
                                      .setPrimaryText("Send your second email")
                                      .setSecondaryText("Tap the envelop to start composing your second email")
                                      .setAnimationInterpolator(new FastOutSlowInInterpolator())
                                      .show();
                    }
                })
                .show();

@kndtime kndtime closed this as completed Aug 30, 2016
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

2 participants