textView.setMovementMethod(LinkMovementMethod.getInstance());
final Matcher matcher = CHAR_DASH.matcher(text);
while (matcher.find()) {
- spannable.setSpan(new NonLinkClickableSpan(textColorFg), matcher.start(),
+ spannable.setSpan(new NonLinkClickableSpan(), matcher.start(),
matcher.end(),
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
}
// The singleton pattern doesn't work here--we need a separate instance for
// each span.
- final int color;
-
- public NonLinkClickableSpan(int color) {
- this.color = color;
+ public NonLinkClickableSpan() {
}
// Won't see these on a long-click.
@Override
public void updateDrawState(TextPaint ds) {
- super.updateDrawState(ds);
- ds.setUnderlineText(false);
- ds.setColor(color);
}
}