0

In my Android Studio project, the default transparency of the showCaseView allows background form text to clash with the showCaseView text. To resolve this, my goal is to change the transparency of the showCaseView to fully opaque. How do I accomplish this?

In the theme page, there doesn't appear to be a overridable setting for transparency. https://github.com/amlcurran/ShowcaseView/blob/master/sample/src/main/res/values/styles.xml

Here is the code I use to initialize my showCaseView:

  showcaseView = new ShowcaseView.Builder(this)
                    .setTarget(Target.NONE)
                    .setOnClickListener(this)
                    .setContentTitle("some text")
                    .setContentText("some text")
                    .build();
            showcaseView.setButtonText("next");

and here is the code I use to transition through showcase states:

switch(tutorialCounter)
    {
        case 0 :
            showcaseView.setTarget(t1);
            showcaseView.setOnClickListener(this);
            showcaseView.setContentTitle("some text");
            showcaseView.setContentText("some text");
            tutorialCounter++;
            break;
        case 1:
            showcaseView.setTarget(t2);
            showcaseView.setOnClickListener(this);
            showcaseView.setContentTitle("some text");
            showcaseView.setContentText("some text");
            tutorialCounter++;
            break;
        case 2:
            showcaseView.setTarget(t3);
            showcaseView.setOnClickListener(this);
            showcaseView.setContentTitle("some text");
            showcaseView.setContentText("some text");
            tutorialCounter++;
            break;
        case 3:
            showcaseView.hide();
    }

UPDATE: I managed to change the background color, but this also covered the item in the showcase circle.

screenshot of opaque background

There seems to be a layer of transparent blue applied over the background, this is the layer I want to change the opacity of, rather than the background

Mr. Negi
  • 154
  • 1
  • 15
  • 1
    All of the `sv_backgroundColor` values have non-opaque alphas. Did you try just using a color with an `ff` alpha? – Mike M. Jun 04 '17 at 02:09
  • This works for changing the background color to opaque, however when the background color is set to opaque it covers the entire screen, including the showcased item. – Mr. Negi Jun 05 '17 at 03:01
  • No repro. You should [edit] your question to show your style changes, and the code you're using to display the `ShowcaseView`. – Mike M. Jun 05 '17 at 04:35
  • I added the code for reproducibility, hopefully this helps. I haven't insofar made any xml style changes. – Mr. Negi Jun 07 '17 at 05:30
  • 1
    How exactly are you setting the opaque background color, then? – Mike M. Jun 07 '17 at 06:02
  • I set the background color using showcaseView.setBackgroundColor(0xFFFFFFFF). I added a screenshot to demonstrate what this does for a fully white, opaque background. It's not in my code sample because I removed it as it doesn't accomplish my intended goal. – Mr. Negi Jun 07 '17 at 09:05
  • 1
    Yeah, after I'd commented, I figured that's what you were doing, and that's your problem. You can't do that. `ShowcaseView` handles drawing itself, and its `View` background needs to be transparent. You'll want to set it through a style, like is shown in the sample. The only other publicly available way to do it is by setting your own `ShowcaseDrawer`, but that's more work than is necessary, since you'd need to configure that, too. – Mike M. Jun 07 '17 at 09:17
  • I got it working funilly enough just using this custom theme: `` It surprises me that this somehow has a different functionality than `setBackgroundColor()`. Thanks for your assistance. – Mr. Negi Jun 07 '17 at 17:28

0 Answers0