LinkMovementMethodCompat


public class LinkMovementMethodCompat extends LinkMovementMethod


Backwards compatible version of LinkMovementMethod which fixes the issue that links can be triggered for touches outside of line bounds before Android V.

Summary

Public methods

static @NonNull LinkMovementMethodCompat

Retrieves the singleton instance of LinkMovementMethodCompat.

boolean
onTouchEvent(
    @Nullable TextView widget,
    @Nullable Spannable buffer,
    @Nullable MotionEvent event
)

Inherited methods

From android.text.method.BaseMovementMethod
int
boolean
nextParagraph(TextView widget, Spannable buffer)
boolean
boolean
onKeyDown(TextView widget, Spannable text, int keyCode, KeyEvent event)
boolean
onKeyOther(TextView widget, Spannable text, KeyEvent event)
boolean
onKeyUp(TextView widget, Spannable text, int keyCode, KeyEvent event)
boolean
boolean
From android.text.method.LinkMovementMethod
boolean
boolean
down(TextView widget, Spannable buffer)
static MovementMethod
boolean
handleMovementKey(
    TextView widget,
    Spannable buffer,
    int keyCode,
    int movementMetaState,
    KeyEvent event
)
void
initialize(TextView widget, Spannable text)
boolean
left(TextView widget, Spannable buffer)
void
onTakeFocus(TextView view, Spannable text, int dir)
boolean
right(TextView widget, Spannable buffer)
boolean
up(TextView widget, Spannable buffer)
From android.text.method.ScrollingMovementMethod
boolean
bottom(TextView widget, Spannable buffer)
boolean
end(TextView widget, Spannable buffer)
boolean
home(TextView widget, Spannable buffer)
boolean
lineEnd(TextView widget, Spannable buffer)
boolean
lineStart(TextView widget, Spannable buffer)
boolean
pageDown(TextView widget, Spannable buffer)
boolean
pageUp(TextView widget, Spannable buffer)
boolean
top(TextView widget, Spannable buffer)

Public methods

getInstance

Added in 1.11.0
public static @NonNull LinkMovementMethodCompat getInstance()

Retrieves the singleton instance of LinkMovementMethodCompat.

Returns
@NonNull LinkMovementMethodCompat

the singleton instance of LinkMovementMethodCompat

onTouchEvent

public boolean onTouchEvent(
    @Nullable TextView widget,
    @Nullable Spannable buffer,
    @Nullable MotionEvent event
)