public class BetterLinkMovementMethod
extends android.text.method.LinkMovementMethod
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BetterLinkMovementMethod.ClickableSpanWithText
A wrapper to support all
ClickableSpans that may or may not provide URLs. |
protected static class |
BetterLinkMovementMethod.LongPressTimer |
static interface |
BetterLinkMovementMethod.OnLinkClickListener |
static interface |
BetterLinkMovementMethod.OnLinkLongClickListener |
| Modifier | Constructor and Description |
|---|---|
protected |
BetterLinkMovementMethod() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
dispatchUrlClick(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan) |
protected void |
dispatchUrlLongClick(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan) |
protected android.text.style.ClickableSpan |
findClickableSpanUnderTouch(android.widget.TextView textView,
android.text.Spannable text,
android.view.MotionEvent event)
Determines the touched location inside the TextView's text and returns the ClickableSpan found under it (if any).
|
static BetterLinkMovementMethod |
getInstance()
Get a static instance of BetterLinkMovementMethod.
|
protected void |
highlightUrl(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan,
android.text.Spannable text)
Adds a background color span at clickableSpan's location.
|
static BetterLinkMovementMethod |
linkify(int linkifyMask,
android.app.Activity activity)
Recursively register a
BetterLinkMovementMethod on every TextView inside a layout. |
static BetterLinkMovementMethod |
linkify(int linkifyMask,
android.widget.TextView... textViews) |
static BetterLinkMovementMethod |
linkify(int linkifyMask,
android.view.ViewGroup viewGroup)
Recursively register a
BetterLinkMovementMethod on every TextView inside a layout. |
static BetterLinkMovementMethod |
linkifyHtml(android.app.Activity activity)
Like
linkify(int, TextView...), but can be used for TextViews with HTML links. |
static BetterLinkMovementMethod |
linkifyHtml(android.widget.TextView... textViews)
Like
linkify(int, TextView...), but can be used for TextViews with HTML links. |
static BetterLinkMovementMethod |
linkifyHtml(android.view.ViewGroup viewGroup)
Like
linkify(int, TextView...), but can be used for TextViews with HTML links. |
static BetterLinkMovementMethod |
newInstance()
Return a new instance of BetterLinkMovementMethod.
|
boolean |
onTouchEvent(android.widget.TextView textView,
android.text.Spannable text,
android.view.MotionEvent event) |
protected void |
removeLongPressCallback(android.widget.TextView textView)
Remove the long-press detection timer.
|
protected void |
removeUrlHighlightColor(android.widget.TextView textView)
Removes the highlight color under the Url.
|
BetterLinkMovementMethod |
setOnLinkClickListener(BetterLinkMovementMethod.OnLinkClickListener clickListener)
Set a listener that will get called whenever any link is clicked on the TextView.
|
BetterLinkMovementMethod |
setOnLinkLongClickListener(BetterLinkMovementMethod.OnLinkLongClickListener longClickListener)
Set a listener that will get called whenever any link is clicked on the TextView.
|
protected void |
startTimerForRegisteringLongClick(android.widget.TextView textView,
BetterLinkMovementMethod.LongPressTimer.OnTimerReachedListener longClickListener) |
canSelectArbitrarily, down, handleMovementKey, initialize, left, onTakeFocus, right, upbottom, end, home, lineEnd, lineStart, pageDown, pageUp, topgetMovementMetaState, onGenericMotionEvent, onKeyDown, onKeyOther, onKeyUp, onTrackballEventpublic static BetterLinkMovementMethod newInstance()
public static BetterLinkMovementMethod linkify(int linkifyMask, android.widget.TextView... textViews)
linkifyMask - One of Linkify.ALL, Linkify.PHONE_NUMBERS, Linkify.MAP_ADDRESSES,
Linkify.WEB_URLS and Linkify.EMAIL_ADDRESSES.textViews - The TextViews on which a BetterLinkMovementMethod should be registered.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod linkifyHtml(android.widget.TextView... textViews)
linkify(int, TextView...), but can be used for TextViews with HTML links.textViews - The TextViews on which a BetterLinkMovementMethod should be registered.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod linkify(int linkifyMask, android.view.ViewGroup viewGroup)
BetterLinkMovementMethod on every TextView inside a layout.linkifyMask - One of Linkify.ALL, Linkify.PHONE_NUMBERS, Linkify.MAP_ADDRESSES,
Linkify.WEB_URLS and Linkify.EMAIL_ADDRESSES.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod linkifyHtml(android.view.ViewGroup viewGroup)
linkify(int, TextView...), but can be used for TextViews with HTML links.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod linkify(int linkifyMask, android.app.Activity activity)
BetterLinkMovementMethod on every TextView inside a layout.linkifyMask - One of Linkify.ALL, Linkify.PHONE_NUMBERS, Linkify.MAP_ADDRESSES,
Linkify.WEB_URLS and Linkify.EMAIL_ADDRESSES.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod linkifyHtml(android.app.Activity activity)
linkify(int, TextView...), but can be used for TextViews with HTML links.BetterLinkMovementMethod on the TextViews.public static BetterLinkMovementMethod getInstance()
public BetterLinkMovementMethod setOnLinkClickListener(BetterLinkMovementMethod.OnLinkClickListener clickListener)
public BetterLinkMovementMethod setOnLinkLongClickListener(BetterLinkMovementMethod.OnLinkLongClickListener longClickListener)
public boolean onTouchEvent(android.widget.TextView textView,
android.text.Spannable text,
android.view.MotionEvent event)
onTouchEvent in interface android.text.method.MovementMethodonTouchEvent in class android.text.method.LinkMovementMethodprotected android.text.style.ClickableSpan findClickableSpanUnderTouch(android.widget.TextView textView,
android.text.Spannable text,
android.view.MotionEvent event)
protected void highlightUrl(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan,
android.text.Spannable text)
protected void removeUrlHighlightColor(android.widget.TextView textView)
protected void startTimerForRegisteringLongClick(android.widget.TextView textView,
BetterLinkMovementMethod.LongPressTimer.OnTimerReachedListener longClickListener)
protected void removeLongPressCallback(android.widget.TextView textView)
protected void dispatchUrlClick(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan)
protected void dispatchUrlLongClick(android.widget.TextView textView,
android.text.style.ClickableSpan clickableSpan)