ArrowKeyMovementMethod
open class ArrowKeyMovementMethod : BaseMovementMethod, MovementMethod
A movement method that provides cursor movement and selection. Supports displaying the context menu on DPad Center.
Summary
Inherited functions |
From class BaseMovementMethod
Int |
getMovementMetaState(buffer: Spannable!, event: KeyEvent!)
Gets the meta state used for movement using the modifiers tracked by the text buffer as well as those present in the key event. The movement meta state excludes the state of locked modifiers or the SHIFT key since they are not used by movement actions (but they may be used for selection).
|
Boolean |
onGenericMotionEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)
|
Boolean |
onKeyDown(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)
|
Boolean |
onKeyOther(widget: TextView!, text: Spannable!, event: KeyEvent!)
|
Boolean |
onKeyUp(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)
|
Boolean |
onTrackballEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)
|
|
Public constructors
ArrowKeyMovementMethod
ArrowKeyMovementMethod()
Public methods
canSelectArbitrarily
open fun canSelectArbitrarily(): Boolean
nextParagraph
open fun nextParagraph(
widget: TextView,
buffer: Spannable
): Boolean
Performs a next paragraph movement action.
Parameters |
widget |
TextView: This value cannot be null . |
buffer |
Spannable: This value cannot be null . |
Return |
Boolean |
true if the event was handled, otherwise false. |
previousParagraph
open fun previousParagraph(
widget: TextView,
buffer: Spannable
): Boolean
Performs a previous paragraph movement action.
Parameters |
widget |
TextView: This value cannot be null . |
buffer |
Spannable: This value cannot be null . |
Return |
Boolean |
true if the event was handled, otherwise false. |
Protected methods
handleMovementKey
protected open fun handleMovementKey(
widget: TextView!,
buffer: Spannable!,
keyCode: Int,
movementMetaState: Int,
event: KeyEvent!
): Boolean
Parameters |
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
event |
KeyEvent!: The key event. |
keyCode |
Int: The key code. |
movementMetaState |
Int: The keyboard meta states used for movement. |
Return |
Boolean |
True if the event was handled. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]