Better Link Movement Method Versions Save

Attempts to improve how clickable links are detected, highlighted and handled in TextView

v2.2.0

6 years ago
  • Make methods of ClickableSpanWithText and OnTimerReachedListener accessible by sub-classes of BetterLinkMovementMethod.
  • #8: Avoid removing any highlight spans that were not set by BetterLinkMovementMethod.

v2.1.0

6 years ago

This release fixes two critical bugs:

  • #9 Long-pressing on text results in an exception if there is no clickable span present at the pressed location.
  • #11 Clicking a ClickableSpan results in an exception if the text is selectable (android:textIsSelectable="true").

v2.0

6 years ago

Library

  • Support for listening to long-clicks on URLs
  • Fixed a bug where URLs were staying highlighted even after lifting finger in some cases.
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

  • Replaced dark theme with light
  • Replaced custom floating menu with PopupMenu, which have a nice entry animation on Marshmallow and above.

v1.2.1

7 years ago

Bugfix: BetterLinkMovementMethod wasn't getting applied in some cases via linkifyHtml(). This release fixes that.

v1.1

7 years ago

Library:

  • Added support for all spans that extend ClickableSpan. The library was previously only limited to URLSpan.
  • Fixed a memory leak issue.
  • Added 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:

  • Added separate floating menus for phone number, email and map links.