ShowcaseView icon indicating copy to clipboard operation
ShowcaseView copied to clipboard

Add API for showing multiple Showcases

Open amlcurran opened this issue 9 years ago • 9 comments

This seems to be a commonly requested feature.

My current thinking on this API is usage along the lines of:

sv = new ShowcaseView.Builder(this)
                .withMaterialShowcase()
                .setTarget(target)
                .setContentTitle("Item one")
                .setContentText("Some description")
sv.thenShow()
    .withMaterialShowcase()
    .setTarget(target2)
    .setContentTitle("Item two")
    .setContentText("Some description")
    .build();

amlcurran avatar Dec 26 '15 13:12 amlcurran

One problem I am foreseeing here is when the first Showcase has a singleShot() already then it won't be shown, then second Showcase wouldn't be shown as well. If I am processing it properl...

johnernest02 avatar Dec 28 '15 05:12 johnernest02

Whereas, if we could inflate the ShowcaseViews, then kind of put them in a list, then it wouldn't be a problem as we can be sure that all the ShowcaseViews will be gone over. And it would be pretty flexible.

johnernest02 avatar Dec 28 '15 05:12 johnernest02

I got this idea from this blog that use a past version of your library : https://www.novoda.com/blog/showcaseview-customisation-and-having-consecutive-showcases/

johnernest02 avatar Dec 28 '15 05:12 johnernest02

ha I know that blog :) got any suggestions @blundell, as you wrote it?!

amlcurran avatar Dec 30 '15 14:12 amlcurran

:smiley_cat: not sure what I can add, the list of showcase views could be done under the hood of the api Alex suggests in the original issue. Then a normal showcase view of 1 item can just be a list of size 1.

blundell avatar Dec 31 '15 12:12 blundell

I will suggest you to create another class that contains a queue. You can add how many showcases you want (The build method can be refactored to not show the showcase). When you call the show method on the queue, it will show one by one with an interval of a second between them. If a showcase in the queue was already displayed, it is not displayed, going to the next showcase in the queue.

sandrocsimas avatar Mar 01 '16 01:03 sandrocsimas

It will be nice to have an optional callback in each showcase to tell if it can be displayed. In fragments (TabLayout) for example, the showcase can be only displayed if the fragment is visible to user (getUserVisibleHint method).

sandrocsimas avatar Mar 01 '16 02:03 sandrocsimas

Look at this another library: https://github.com/deano2390/MaterialShowcaseView

sandrocsimas avatar Mar 08 '16 21:03 sandrocsimas

May I know how to customize it to work with images instead of colors?

anshul90 avatar Mar 29 '16 10:03 anshul90