Attempts to improve how clickable links are detected, highlighted and handled in TextView
ClickableSpanWithText
and OnTimerReachedListener
accessible by sub-classes of BetterLinkMovementMethod
.BetterLinkMovementMethod
.This release fixes two critical bugs:
ClickableSpan
results in an exception if the text is selectable (android:textIsSelectable="true"
).Library
BetterLinkMovementMethod method = BetterLinkMovementMethod.linkify(Linkify.ALL, textView);
method.setOnLinkLongClickListener((textView, url) -> {
// Do something with the URL and return true to indicate that this URL was handled.
// Otherwise, return false to let Android handle the URL.
return true;
});
Sample
PopupMenu
, which have a nice entry animation on Marshmallow and above.Bugfix: BetterLinkMovementMethod
wasn't getting applied in some cases via linkifyHtml()
. This release fixes that.
Library:
ClickableSpan
. The library was previously only limited to URLSpan
.linkifyHtml()
methods that can be used when Html.fromHtml()
is used for inserting links. An example for its usage can be seen in the sample app.Sample: