MaterialShowcaseView
MaterialShowcaseView copied to clipboard
Cannot change the colors of the dismiss text & the content text when using MaterialShowcaseSequence
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();

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();