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

Cannot change the colors of the dismiss text & the content text when using MaterialShowcaseSequence #191

Open
SuwanTongphu opened this issue Mar 1, 2020 · 1 comment

Comments

@SuwanTongphu
Copy link

SuwanTongphu commented Mar 1, 2020

Here is the code I used. I try assigning different colors to the dismiss text and the content text but the colors are always white.

        ShowcaseConfig config = new ShowcaseConfig();
        config.setDelay(250);
        config.setDismissTextColor(Color.parseColor("#009688"));
        config.setContentTextColor(Color.BLUE);
        MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this);

        sequence.setConfig(config);
        sequence.addSequenceItem(normalPlay,
                "Sequence #1", "OK");
        sequence.addSequenceItem(slowPlay,
                "Sequence #2", "OK");
        sequence.start();

33111

@nelner
Copy link

nelner commented May 7, 2020

I found a work around to solve this issue.
While the config's set colors does not work, I did it via the builder. For example:

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this);
MaterialShowcaseView.Builder sequenceBuilder;

final int COLOR_MASK = getResources().getColor(R.color.colorPrimaryDarkA90);
final int COLOR_DISMISS = getResources().getColor(R.color.colorAccent);

sequenceBuilder = new MaterialShowcaseView.Builder(this)
                .setTarget(findViewById(R.id.add_photos_iv))
                // Set the color of the mask
                .setMaskColour(COLOR_MASK)
                // Set color of the dismiss clickable text view
                .setDismissTextColor(COLOR_DISMISS)
                // Set the message
                .setContentText(R.string.tutorial_image)
                // Set the dismiss button text
                .setDismissText(R.string.tutorial_dismiss);

// Add the configured builder to the sequence
sequence.addSequenceItem(sequenceBuilder.build());

Create more sequenceBuilder if needed and add each of them to the sequence.addSequenceItem
then, do not forget to start the sequence:

// Start the tutorial sequence
sequence.start();

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