11

I am using https://github.com/amlcurran/ShowcaseView library for Showcaseview
how to make rectangle view instead of circle ?
and how to using it for one of the listview item? thanks

1

2 Answers 2

3

Refer to the CustomShowcaseActivity in the sample app. It creates a rectangular showcase. It defines a CustomShowcaseView with a constructor that sets the width and height of the showcase rectangle from resource file dimens.xml:

width = resources.getDimension(R.dimen.custom_showcase_width);
height = resources.getDimension(R.dimen.custom_showcase_height);

The CustomShowcaseActivity is associated to the ShowcaseView in the Builder. This is also where the showcase target is set.

The CustomShowcaseView implements ShowcaseDrawer so you use setShowcaseDrawer(). It's not a drawer, but rather a "draw - er".

The following shows this and targets a listview as you wanted:

ViewTarget target = new ViewTarget(R.id.listView, this);

sv = new ShowcaseView.Builder(this)
            .setTarget(target)
            .setShowcaseDrawer(new CustomShowcaseActivity.CustomShowcaseView(getResources()))
            .build();
2

Take a look at this: MaterialShowCaseView that is a improved version of original ShowCaseView library. It has more featurs like sequence and .withRectangleShape() in it. An example of rectangle showcase is:

    // single example
new MaterialShowcaseView.Builder(this)
    .setTarget(mButtonShow)
    .setDismissText("GOT IT")
    .withRectangleShape() // this makes it rectangle
    .setContentText("This is some amazing feature you should know about")
    .setDelay(withDelay) // optional but starting animations immediately in onCreate can make them choppy
    .singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it is only shown once
    .show();

for use it for one of items, use a if in onBindViewHolder with specific position and show it simply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.