deano2390 / MaterialShowcaseView

A Material Design themed ShowcaseView for Android
Apache License 2.0
2.72k stars 526 forks source link

Sequence doesn't show when MaterialShowcaseView has .build() called #120

Closed WesBunton closed 7 years ago

WesBunton commented 7 years ago

I just found the MaterialShowcaseView library and I love it! Great work! I am having a bit of an issue attempting to invoke the showcase sequence.

Below is an snippet of how I'm invoking a sequence showcase. When I use the "build()" call in the MaterialShowcaseView's, the sequence.start() doesn't show anything on screen. If I switch the "build()" to "show()", it will actually show the showcases, but it won't perform the sequencing, it just stacks them on top of each other simultaneously.

Additionally, if I use the other method for 'addSequenceItem' which takes the "View targetView" as the first parameter, I can't get it to show those sequence items at all.

FYI - I'm developing on a Nexus 6P running 7.1.1. I added the following line to my Gradle file to include this library:

compile 'com.github.deano2390:MaterialShowcaseView:1.1.0@aar'

And here's how I'm trying to invoke the ShowcaseView sequence:

        MaterialShowcaseView lockscreenTip = new MaterialShowcaseView.Builder(this)
                .setTarget(findViewById(R.id.btn_one))
                .setTitleText("Did you know?")
                .setContentText("You may be prompted to enable a lock screen.")
                .setDismissText("Got It!")
                .build();

        MaterialShowcaseView startTip = new MaterialShowcaseView.Builder(this)
                .setTarget(findViewById(R.id.btn_one))
                .setContentText("Use this button to get.")
                .setDismissText("Got It!")
                .build();

        tipsSequence.setConfig(config);
        tipsSequence.addSequenceItem(lockscreenTip);
        tipsSequence.addSequenceItem(startTip);
        tipsSequence.start();
rcketscientist commented 7 years ago

Seeing the same thing with a similar setup, which is odd because I swear it worked once when I was first working on it. It's also strange since the standard way of setting the view calls the .build(). I think the problem actually lies elsewhere.

WesBunton commented 7 years ago

Perhaps you're correct. Admittedly, this was found on the very first time I came across this library and attempted to implement it. I understood that this could have been an issue with the implementation or some other incompatibility that I was not seeing at the time. I'm glad I'm not the only one to have seen it though!

rcketscientist commented 7 years ago

Hah, figured it out.

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID);

is a single use constructor. Just drop the ID. One of the many annoyances of losing doc when using gradle dependencies.

WesBunton commented 7 years ago

Oh awesome! You're the man! Thanks for the info!

Since I originally opened this issue, I'll assume the responsibility and close it now.