Package icyllis.modernui.text.method

# Class ArrowKeyMovementMethod

java.lang.Object
icyllis.modernui.text.method.BaseMovementMethod
icyllis.modernui.text.method.ArrowKeyMovementMethod

All Implemented Interfaces:
  `MovementMethod`

@ParametersAreNonnullByDefault public class ArrowKeyMovementMethod extends BaseMovementMethod
A movement method that provides cursor movement and selection.

Modified from Android.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArrowKeyMovementMethod()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `bottom(TextView widget, Spannable buffer)`
  Performs a bottom movement action.
  `boolean`
  `canSelectArbitrarily()`
  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`
  `down(TextView widget, Spannable buffer)`
  Performs a down movement action.
  `protected boolean`
  `end(TextView widget, Spannable buffer)`
  Performs an end movement action.
  `static MovementMethod`
  `getInstance()`
  `protected boolean`
  `home(TextView widget, Spannable buffer)`
  Performs a home movement action.
  `void`
  `initialize(TextView widget, Spannable text)`
  `protected boolean`
  `left(TextView widget, Spannable buffer)`
  Performs a left movement action.
  `protected boolean`
  `leftWord(TextView widget, Spannable buffer)`
  `protected boolean`
  `lineEnd(TextView widget, Spannable buffer)`
  Performs a line-end movement action.
  `protected boolean`
  `lineStart(TextView widget, Spannable buffer)`
  Performs a line-start movement action.
  `void`
  `onTakeFocus(TextView view, Spannable text, int dir)`
  `boolean`
  `onTouchEvent(TextView widget, Spannable buffer, MotionEvent event)`
  `protected boolean`
  `pageDown(TextView widget, Spannable buffer)`
  Performs a page-down movement action.
  `protected boolean`
  `pageUp(TextView widget, Spannable buffer)`
  Performs a page-up movement action.
  `protected boolean`
  `right(TextView widget, Spannable buffer)`
  Performs a right movement action.
  `protected boolean`
  `rightWord(TextView widget, Spannable buffer)`
  `protected boolean`
  `top(TextView widget, Spannable buffer)`
  Performs a top movement action.
  `protected boolean`
  `up(TextView widget, Spannable buffer)`
  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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ArrowKeyMovementMethod

    public ArrowKeyMovementMethod()

- ## Method Details

  - ### getInstance

    public static MovementMethod getInstance()

  - ### left

    protected boolean left(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a left movement action. Moves the cursor or scrolls left by one character.
    Overrides:
      `left` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### right

    protected boolean right(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a right movement action. Moves the cursor or scrolls right by one character.
    Overrides:
      `right` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### up

    protected boolean up(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs an up movement action. Moves the cursor or scrolls up by one line.
    Overrides:
      `up` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### down

    protected boolean down(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a down movement action. Moves the cursor or scrolls down by one line.
    Overrides:
      `down` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### pageUp

    protected boolean pageUp(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a page-up movement action. Moves the cursor or scrolls up by one page.
    Overrides:
      `pageUp` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### pageDown

    protected boolean pageDown(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a page-down movement action. Moves the cursor or scrolls down by one page.
    Overrides:
      `pageDown` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### top

    protected boolean top(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a top movement action. Moves the cursor or scrolls to the top of the buffer.
    Overrides:
      `top` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### bottom

    protected boolean bottom(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Performs a bottom movement action. Moves the cursor or scrolls to the bottom of the buffer.
    Overrides:
      `bottom` in class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### lineStart

    protected boolean lineStart(TextView widget, Spannable buffer)
    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 class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### lineEnd

    protected boolean lineEnd(TextView widget, Spannable buffer)
    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 class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### leftWord

    protected boolean leftWord(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Overrides:
      `leftWord` in class `BaseMovementMethod`

  - ### rightWord

    protected boolean rightWord(TextView widget, Spannable buffer)
    Description copied from class: `BaseMovementMethod`
    Overrides:
      `rightWord` in class `BaseMovementMethod`

  - ### home

    protected boolean home(TextView widget, Spannable buffer)
    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 class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### end

    protected boolean end(TextView widget, Spannable buffer)
    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 class `BaseMovementMethod`
    Parameters:
      `widget` - The text view.
      `buffer` - The text buffer.
    Returns:
      True if the event was handled.

  - ### onTouchEvent

    public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event)
    Specified by:
      `onTouchEvent` in interface `MovementMethod`
    Overrides:
      `onTouchEvent` in class `BaseMovementMethod`

  - ### 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 interface `MovementMethod`
    Overrides:
      `canSelectArbitrarily` in class `BaseMovementMethod`

  - ### initialize

    public void initialize(TextView widget, Spannable text)
    Specified by:
      `initialize` in interface `MovementMethod`
    Overrides:
      `initialize` in class `BaseMovementMethod`

  - ### onTakeFocus

    public void onTakeFocus(TextView view, Spannable text, int dir)
    Specified by:
      `onTakeFocus` in interface `MovementMethod`
    Overrides:
      `onTakeFocus` in class `BaseMovementMethod`