Package icyllis.modernui.text.method
Class ArrowKeyMovementMethod
java.lang.Object
icyllis.modernui.text.method.BaseMovementMethod
icyllis.modernui.text.method.ArrowKeyMovementMethod
- All Implemented Interfaces:
MovementMethod
A movement method that provides cursor movement and selection.
Modified from Android.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Performs a bottom movement action.boolean
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.protected boolean
Performs an end movement action.static MovementMethod
protected boolean
Performs a home movement action.void
initialize
(TextView widget, Spannable text) protected boolean
Performs a left movement action.protected boolean
protected boolean
Performs a line-end movement action.protected boolean
Performs a line-start movement action.void
onTakeFocus
(TextView view, Spannable text, int dir) boolean
onTouchEvent
(TextView widget, Spannable buffer, MotionEvent event) protected boolean
Performs a page-down movement action.protected boolean
Performs a page-up movement action.protected boolean
Performs a right movement action.protected boolean
protected boolean
Performs a top movement action.protected boolean
Performs an up movement action.Methods inherited from class icyllis.modernui.text.method.BaseMovementMethod
handleMovementKey, onGenericMotionEvent, onKeyDown, onKeyUp, scrollBottom, scrollDown, scrollLeft, scrollLineEnd, scrollLineStart, scrollPageDown, scrollPageUp, scrollRight, scrollTop, scrollUp
-
Constructor Details
-
ArrowKeyMovementMethod
public ArrowKeyMovementMethod()
-
-
Method Details
-
getInstance
-
left
Description copied from class:BaseMovementMethod
Performs a left movement action. Moves the cursor or scrolls left by one character.- Overrides:
left
in classBaseMovementMethod
- 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 classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
up
Description copied from class:BaseMovementMethod
Performs an up movement action. Moves the cursor or scrolls up by one line.- Overrides:
up
in classBaseMovementMethod
- 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 classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
pageUp
Description copied from class:BaseMovementMethod
Performs a page-up movement action. Moves the cursor or scrolls up by one page.- Overrides:
pageUp
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
pageDown
Description copied from class:BaseMovementMethod
Performs a page-down movement action. Moves the cursor or scrolls down by one page.- Overrides:
pageDown
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
top
Description copied from class:BaseMovementMethod
Performs a top movement action. Moves the cursor or scrolls to the top of the buffer.- Overrides:
top
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
bottom
Description copied from class:BaseMovementMethod
Performs a bottom movement action. Moves the cursor or scrolls to the bottom of the buffer.- Overrides:
bottom
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
lineStart
Description copied from class:BaseMovementMethod
Performs a line-start movement action. Moves the cursor or scrolls to the start of the line.- Overrides:
lineStart
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
lineEnd
Description copied from class:BaseMovementMethod
Performs a line-end movement action. Moves the cursor or scrolls to the end of the line.- Overrides:
lineEnd
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
leftWord
Description copied from class:BaseMovementMethod
- Overrides:
leftWord
in classBaseMovementMethod
-
rightWord
Description copied from class:BaseMovementMethod
- Overrides:
rightWord
in classBaseMovementMethod
-
home
Description copied from class:BaseMovementMethod
Performs a home movement action. Moves the cursor or scrolls to the start of the line or to the top of the document depending on whether the insertion point is being moved or the document is being scrolled.- Overrides:
home
in classBaseMovementMethod
- Parameters:
widget
- The text view.buffer
- The text buffer.- Returns:
- True if the event was handled.
-
end
Description copied from class:BaseMovementMethod
Performs an end movement action. Moves the cursor or scrolls to the start of the line or to the top of the document depending on whether the insertion point is being moved or the document is being scrolled.- Overrides:
end
in classBaseMovementMethod
- 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 classBaseMovementMethod
-
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
-
initialize
- Specified by:
initialize
in interfaceMovementMethod
- Overrides:
initialize
in classBaseMovementMethod
-
onTakeFocus
- Specified by:
onTakeFocus
in interfaceMovementMethod
- Overrides:
onTakeFocus
in classBaseMovementMethod
-