Package icyllis.modernui.text.method
Class LinkMovementMethod
java.lang.Object
icyllis.modernui.text.method.BaseMovementMethod
icyllis.modernui.text.method.ScrollingMovementMethod
icyllis.modernui.text.method.LinkMovementMethod
- All Implemented Interfaces:
MovementMethod
A movement method that traverses links in the text buffer and scrolls if necessary.
Supports clicking on links with DPad Center or Enter.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this movement method allows arbitrary selection of any text; false if it has no selection (like a movement method that only scrolls) or a constrained selection (for example limited to links.protected boolean
Performs a down movement action.static MovementMethod
void
initialize
(TextView widget, Spannable text) protected boolean
Performs a left movement action.void
onTakeFocus
(TextView view, Spannable text, int dir) boolean
onTouchEvent
(TextView widget, Spannable buffer, MotionEvent event) protected boolean
Performs a right movement action.protected boolean
Performs an up movement action.Methods inherited from class icyllis.modernui.text.method.ScrollingMovementMethod
bottom, end, home, lineEnd, lineStart, pageDown, pageUp, top
Methods inherited from class icyllis.modernui.text.method.BaseMovementMethod
handleMovementKey, leftWord, onGenericMotionEvent, onKeyDown, onKeyUp, rightWord, scrollBottom, scrollDown, scrollLeft, scrollLineEnd, scrollLineStart, scrollPageDown, scrollPageUp, scrollRight, scrollTop, scrollUp
-
Constructor Details
-
LinkMovementMethod
public LinkMovementMethod()
-
-
Method Details
-
getInstance
-
canSelectArbitrarily
public boolean canSelectArbitrarily()Description copied from interface:MovementMethod
Returns true if this movement method allows arbitrary selection of any text; false if it has no selection (like a movement method that only scrolls) or a constrained selection (for example limited to links. The "Select All" menu item is disabled if arbitrary selection is not allowed.- Specified by:
canSelectArbitrarily
in interfaceMovementMethod
- Overrides:
canSelectArbitrarily
in classBaseMovementMethod
-
up
Description copied from class:BaseMovementMethod
Performs an up movement action. Moves the cursor or scrolls up by one line.- Overrides:
up
in classScrollingMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
down
Description copied from class:BaseMovementMethod
Performs a down movement action. Moves the cursor or scrolls down by one line.- Overrides:
down
in classScrollingMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
left
Description copied from class:BaseMovementMethod
Performs a left movement action. Moves the cursor or scrolls left by one character.- Overrides:
left
in classScrollingMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
right
Description copied from class:BaseMovementMethod
Performs a right movement action. Moves the cursor or scrolls right by one character.- Overrides:
right
in classScrollingMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
onTouchEvent
- Specified by:
onTouchEvent
in interfaceMovementMethod
- Overrides:
onTouchEvent
in classScrollingMovementMethod
-
initialize
- Specified by:
initialize
in interfaceMovementMethod
- Overrides:
initialize
in classBaseMovementMethod
-
onTakeFocus
- Specified by:
onTakeFocus
in interfaceMovementMethod
- Overrides:
onTakeFocus
in classScrollingMovementMethod
-