The append() method now checks if autoLink is set and adds the
URLSpans to given text before appending to the existing text.
Fixes https://code.google.com/p/android/issues/detail?id=1244
Fixes https://code.google.com/p/android/issues/detail?id=191353
Bug:
1404366
Bug:
25222125
Change-Id: I47a8beec9799e4f92ce266ceed41a634b7f7cc96
}
((Editable) mText).append(text, start, end);
+
+ if (mAutoLinkMask != 0) {
+ boolean linksWereAdded = Linkify.addLinks((Spannable) mText, mAutoLinkMask);
+ // Do not change the movement method for text that support text selection as it
+ // would prevent an arbitrary cursor displacement.
+ if (linksWereAdded && mLinksClickable && !textCanBeSelected()) {
+ setMovementMethod(LinkMovementMethod.getInstance());
+ }
+ }
}
private void updateTextColors() {