BaseMovementMethod
open class BaseMovementMethod : MovementMethod
kotlin.Any | |
↳ | android.text.method.BaseMovementMethod |
Base classes for movement methods.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
open Boolean | |
open Unit |
initialize(widget: TextView!, text: Spannable!) |
open Boolean |
nextParagraph(widget: TextView, buffer: Spannable) Performs a next paragraph movement action. |
open Boolean |
onGenericMotionEvent(widget: TextView!, text: Spannable!, event: MotionEvent!) |
open Boolean | |
open Boolean |
onKeyOther(widget: TextView!, text: Spannable!, event: KeyEvent!) |
open Boolean | |
open Unit |
onTakeFocus(widget: TextView!, text: Spannable!, direction: Int) |
open Boolean |
onTouchEvent(widget: TextView!, text: Spannable!, event: MotionEvent!) |
open Boolean |
onTrackballEvent(widget: TextView!, text: Spannable!, event: MotionEvent!) |
open Boolean |
previousParagraph(widget: TextView, buffer: Spannable) Performs a previous paragraph movement action. |
Protected methods | |
---|---|
open Boolean |
Performs a bottom movement action. |
open Boolean |
Performs a down movement action. |
open Boolean |
Performs an end movement action. |
open 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. |
open Boolean |
handleMovementKey(widget: TextView!, buffer: Spannable!, keyCode: Int, movementMetaState: Int, event: KeyEvent!) Performs a movement key action. |
open Boolean |
Performs a home movement action. |
open Boolean |
Performs a left movement action. |
open Boolean |
Performs a line-end movement action. |
open Boolean |
Performs a line-start movement action. |
open Boolean |
Performs a page-down movement action. |
open Boolean |
Performs a page-up movement action. |
open Boolean |
Performs a right movement action. |
open Boolean |
Performs a top movement action. |
open Boolean |
Performs an up movement action. |
Public constructors
BaseMovementMethod
BaseMovementMethod()
Public methods
nextParagraph
open fun nextParagraph(
widget: TextView,
buffer: Spannable
): Boolean
Performs a next paragraph movement action.
Parameters | |
---|---|
widget |
TextView: the text view This value cannot be null . |
buffer |
Spannable: the text buffer This value cannot be null . |
Return | |
---|---|
Boolean |
true if the event was handled, otherwise false. |
onGenericMotionEvent
open fun onGenericMotionEvent(
widget: TextView!,
text: Spannable!,
event: MotionEvent!
): Boolean
onKeyDown
open fun onKeyDown(
widget: TextView!,
text: Spannable!,
keyCode: Int,
event: KeyEvent!
): Boolean
onKeyOther
open fun onKeyOther(
widget: TextView!,
text: Spannable!,
event: KeyEvent!
): Boolean
onKeyUp
open fun onKeyUp(
widget: TextView!,
text: Spannable!,
keyCode: Int,
event: KeyEvent!
): Boolean
onTakeFocus
open fun onTakeFocus(
widget: TextView!,
text: Spannable!,
direction: Int
): Unit
onTouchEvent
open fun onTouchEvent(
widget: TextView!,
text: Spannable!,
event: MotionEvent!
): Boolean
onTrackballEvent
open fun onTrackballEvent(
widget: TextView!,
text: Spannable!,
event: MotionEvent!
): Boolean
previousParagraph
open fun previousParagraph(
widget: TextView,
buffer: Spannable
): Boolean
Performs a previous paragraph movement action.
Parameters | |
---|---|
widget |
TextView: the text view This value cannot be null . |
buffer |
Spannable: the text buffer This value cannot be null . |
Return | |
---|---|
Boolean |
true if the event was handled, otherwise false. |
Protected methods
bottom
protected open fun bottom(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a bottom movement action. Moves the cursor or scrolls to the bottom of the buffer.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
down
protected open fun down(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a down movement action. Moves the cursor or scrolls down by one line.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
end
protected open fun end(
widget: TextView!,
buffer: Spannable!
): Boolean
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.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
getMovementMetaState
protected open fun getMovementMetaState(
buffer: Spannable!,
event: KeyEvent!
): Int
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).
Parameters | |
---|---|
buffer |
Spannable!: The text buffer. |
event |
KeyEvent!: The key event. |
Return | |
---|---|
Int |
The keyboard meta states used for movement. |
handleMovementKey
protected open fun handleMovementKey(
widget: TextView!,
buffer: Spannable!,
keyCode: Int,
movementMetaState: Int,
event: KeyEvent!
): Boolean
Performs a movement key action. The default implementation decodes the key down and invokes movement actions such as down
and up
. onKeyDown(android.widget.TextView,android.text.Spannable,int,android.view.KeyEvent)
calls this method once to handle an KeyEvent#ACTION_DOWN
. onKeyOther(android.widget.TextView,android.text.Spannable,android.view.KeyEvent)
calls this method repeatedly to handle each repetition of an KeyEvent#ACTION_MULTIPLE
.
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. |
home
protected open fun home(
widget: TextView!,
buffer: Spannable!
): Boolean
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.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
left
protected open fun left(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a left movement action. Moves the cursor or scrolls left by one character.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
lineEnd
protected open fun lineEnd(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a line-end movement action. Moves the cursor or scrolls to the end of the line.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
lineStart
protected open fun lineStart(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a line-start movement action. Moves the cursor or scrolls to the start of the line.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
pageDown
protected open fun pageDown(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a page-down movement action. Moves the cursor or scrolls down by one page.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
pageUp
protected open fun pageUp(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a page-up movement action. Moves the cursor or scrolls up by one page.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
right
protected open fun right(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a right movement action. Moves the cursor or scrolls right by one character.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
top
protected open fun top(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a top movement action. Moves the cursor or scrolls to the top of the buffer.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |
up
protected open fun up(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs an up movement action. Moves the cursor or scrolls up by one line.
Parameters | |
---|---|
widget |
TextView!: The text view. |
buffer |
Spannable!: The text buffer. |
Return | |
---|---|
Boolean |
True if the event was handled. |