BaseMovementMethod

open class BaseMovementMethod : MovementMethod
kotlin.Any
   ↳ android.text.method.BaseMovementMethod

Base classes for movement methods.
Requires API level 11 (Android 3.0, Honeycomb)

Summary

Public constructors

Public methods
open Boolean
onKeyDown(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)

Requires API level 11 (Android 3.0, Honeycomb)

open Unit
onTakeFocus(widget: TextView!, text: Spannable!, direction: Int)

Requires API level 11 (Android 3.0, Honeycomb)

open 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. The "Select All" menu item is disabled if arbitrary selection is not allowed. Requires API level 11 (Android 3.0, Honeycomb)

open Boolean
onKeyOther(widget: TextView!, text: Spannable!, event: KeyEvent!)

If the key listener wants to other kinds of key events, return true, otherwise return false and the caller (i.e. the widget host) will handle the key.

open Boolean
onGenericMotionEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)

Requires API level 12 (Android 3.1, Honeycomb) Requires API level 12 (Android 3.1, Honeycomb)

open Boolean
onTrackballEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)

Requires API level 11 (Android 3.0, Honeycomb)

open Boolean
onTouchEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)

Requires API level 11 (Android 3.0, Honeycomb)

open Boolean
onKeyUp(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)

Requires API level 11 (Android 3.0, Honeycomb)

open Unit
initialize(widget: TextView!, text: Spannable!)

Requires API level 11 (Android 3.0, Honeycomb)

Protected methods
open Boolean
up(widget: TextView!, buffer: Spannable!)

Performs an up movement action.

open Boolean
lineEnd(widget: TextView!, buffer: Spannable!)

Performs a line-end movement action.

open Boolean
bottom(widget: TextView!, buffer: Spannable!)

Performs a bottom movement action.

open Boolean
right(widget: TextView!, buffer: Spannable!)

Performs a right movement action.

open Boolean
lineStart(widget: TextView!, buffer: Spannable!)

Performs a line-start movement action.

open Boolean
end(widget: TextView!, buffer: Spannable!)

Performs an end movement action.

open 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.

open Boolean
down(widget: TextView!, buffer: Spannable!)

Performs a down movement action.

open Boolean
pageUp(widget: TextView!, buffer: Spannable!)

Performs a page-up movement action.

open Boolean
home(widget: TextView!, buffer: Spannable!)

Performs a home movement action.

open Boolean
handleMovementKey(widget: TextView!, buffer: Spannable!, keyCode: Int, movementMetaState: Int, event: KeyEvent!)

Performs a movement key action.

open Boolean
left(widget: TextView!, buffer: Spannable!)

Performs a left movement action.

open Boolean
top(widget: TextView!, buffer: Spannable!)

Performs a top movement action.

open Boolean
pageDown(widget: TextView!, buffer: Spannable!)

Performs a page-down movement action.

Public constructors

<init>

BaseMovementMethod()

Public methods

onKeyDown

added in API level 11
open fun onKeyDown(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!): Boolean

Requires API level 11 (Android 3.0, Honeycomb)

onTakeFocus

added in API level 11
open fun onTakeFocus(widget: TextView!, text: Spannable!, direction: Int): Unit

Requires API level 11 (Android 3.0, Honeycomb)

canSelectArbitrarily

added in API level 11
open fun canSelectArbitrarily(): 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. The "Select All" menu item is disabled if arbitrary selection is not allowed. Requires API level 11 (Android 3.0, Honeycomb)

onKeyOther

added in API level 11
open fun onKeyOther(widget: TextView!, text: Spannable!, event: KeyEvent!): Boolean

If the key listener wants to other kinds of key events, return true, otherwise return false and the caller (i.e. the widget host) will handle the key.
Requires API level 3 (Android 1.5, Cupcake) Requires API level 11 (Android 3.0, Honeycomb)

onGenericMotionEvent

added in API level 12
open fun onGenericMotionEvent(widget: TextView!, text: Spannable!, event: MotionEvent!): Boolean

Requires API level 12 (Android 3.1, Honeycomb) Requires API level 12 (Android 3.1, Honeycomb)

onTrackballEvent

added in API level 11
open fun onTrackballEvent(widget: TextView!, text: Spannable!, event: MotionEvent!): Boolean

Requires API level 11 (Android 3.0, Honeycomb)

onTouchEvent

added in API level 11
open fun onTouchEvent(widget: TextView!, text: Spannable!, event: MotionEvent!): Boolean

Requires API level 11 (Android 3.0, Honeycomb)

onKeyUp

added in API level 11
open fun onKeyUp(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!): Boolean

Requires API level 11 (Android 3.0, Honeycomb)

initialize

added in API level 11
open fun initialize(widget: TextView!, text: Spannable!): Unit

Requires API level 11 (Android 3.0, Honeycomb)

Protected methods

up

added in API level 11
protected open fun up(widget: TextView!, buffer: Spannable!): Boolean

Performs an up movement action. Moves the cursor or scrolls up by one line.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

lineEnd

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

bottom

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

right

added in API level 11
protected open fun right(widget: TextView!, buffer: Spannable!): Boolean

Performs a right movement action. Moves the cursor or scrolls right by one character.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

lineStart

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

end

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

getMovementMetaState

added in API level 11
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).
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
buffer Spannable!: The text buffer.
event Spannable!: The key event.
Return
Int: The keyboard meta states used for movement.

down

added in API level 11
protected open fun down(widget: TextView!, buffer: Spannable!): Boolean

Performs a down movement action. Moves the cursor or scrolls down by one line.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

pageUp

added in API level 11
protected open fun pageUp(widget: TextView!, buffer: Spannable!): Boolean

Performs a page-up movement action. Moves the cursor or scrolls up by one page.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

home

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

handleMovementKey

added in API level 11
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(TextView, Spannable, int, KeyEvent) calls this method once to handle an KeyEvent#ACTION_DOWN. #onKeyOther(TextView, Spannable, KeyEvent) calls this method repeatedly to handle each repetition of an KeyEvent#ACTION_MULTIPLE.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
event TextView!: The key event.
keyCode TextView!: The key code.
movementMetaState TextView!: The keyboard meta states used for movement.
Return
Boolean: True if the event was handled.

left

added in API level 11
protected open fun left(widget: TextView!, buffer: Spannable!): Boolean

Performs a left movement action. Moves the cursor or scrolls left by one character.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

top

added in API level 11
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.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.

pageDown

added in API level 11
protected open fun pageDown(widget: TextView!, buffer: Spannable!): Boolean

Performs a page-down movement action. Moves the cursor or scrolls down by one page.
Requires API level 11 (Android 3.0, Honeycomb)

Parameters
widget TextView!: The text view.
buffer TextView!: The text buffer.
Return
Boolean: True if the event was handled.