Class ShadowAccessibilityInputConnection

java.lang.Object
org.robolectric.shadows.ShadowAccessibilityInputConnection

Shadow of AccessibilityInputConnection that provides a mechanism to simulate text input for Accessibility services using InputConnection APIs. You can get an AccessibilityInputConnection to shadow by calling ShadowAccessibilityInputMethod#setIsConnected(true) and then calling InputMethod#getCurrentInputConnection() on the shadowed InputMethod.

All AccessibilityInputConnection objects which share the same remote will return the same values from their shadow methods. This is equivalent to the behavior of the real AccessibilityInputConnections.

  • Constructor Details

    • ShadowAccessibilityInputConnection

      public ShadowAccessibilityInputConnection()
  • Method Details

    • getCommitTextArguments

      public List<ShadowAccessibilityInputConnection.CommitTextArgs> getCommitTextArguments()
      Returns the list of arguments passed to #commitText(CharSequence, int, TextAttribute).
    • setSurroundingText

      public void setSurroundingText(SurroundingText surroundingText)
      Sets the surrounding text to be returned by #getSurroundingText(int, int, int).
    • getSurroundingTextArguments

      public List<ShadowAccessibilityInputConnection.SurroundingTextArgs> getSurroundingTextArguments()
      Returns the list of arguments passed to #getSurroundingText(int, int, int).
    • getContextMenuActions

      public List<Integer> getContextMenuActions()
      Returns the list of context menu actions performed on this input connection in the order they were received..
    • getEditorActions

      public List<Integer> getEditorActions()
      Returns the list of editor actions performed on this input connection in the order they were received.
    • getKeyEvents

      public List<KeyEvent> getKeyEvents()
      Returns the list of key events sent to this input connection in the order they were received.
    • getSetSelections

      public List<Pair<Integer,Integer>> getSetSelections()
      Returns the list of selections sent to this input connection in the order they were received.