-
Notifications
You must be signed in to change notification settings - Fork 71
how do I set color of the label #11
Comments
I dug through the code a little bit and I think adding a new method |
If memory serves, for this case I used |
Wow. I didn't know you could do that with a This is what I am going with : public CharSequence getLabel(Calendar calendar, int index) {
SpannableStringBuilder builder = new SpannableStringBuilder();
String red = "full";
SpannableString redSpannable= new SpannableString(red);
redSpannable.setSpan(new ForegroundColorSpan(Color.BLUE), 0, red.length(), 0);
builder.append(redSpannable);
return builder;
} So now I suppose there is no need for a PR. Maybe you can include this snippet in the readme so that others can benefit. |
Yeah, but using span if you're always using the same color is not the best idea, complicates life for nothing :) SpannableString span = new SpannableString("full");
span.setSpan(new ForegroundColorSpan(Color.BLUE), 0, span.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
return span; |
Yes, I did that. The code I posted was a generic one lifted from Stack Overflow. I am using the simpler version in my project. Thanks. |
The GIF in the readme shows labels with different colors:
but I don't see any mention of how to do that. Please advise.
The text was updated successfully, but these errors were encountered: