Mark Murphy schrieb:
On Thu, Oct 18, 2012 at 5:35 AM, Jan Burse <[email protected]> wrote:
How can I change the color?
Use getSpans(), find all occurrences of your span, remove the old
span, and replace it with a span with the new color.
It's possible that there is a more efficient alternative than this,
but I am not aware of one.
I went for a custom class:
public class MyForegroundColorSpan extends CharacterStyle
implements UpdateAppearance {
private int color;
public int getForegroundColor() {
return color;
}
public void setForegroundColor(int c) {
color = c;
}
public void updateDrawState(TextPaint ds) {
ds.setColor(color);
}
}
Then using the setter and calling invalidate() on
the text view works like a charm.
Bye
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en