Package org.robolectric.shadows
Class ShadowAccessibilityInputConnection
java.lang.Object
org.robolectric.shadows.ShadowAccessibilityInputConnection
@Implements(value=android.accessibilityservice.InputMethod.AccessibilityInputConnection.class,
minSdk=33,
isInAndroidSdk=false)
public class ShadowAccessibilityInputConnection
extends Object
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class that holds the arguments passed to.invalid reference
#commitText(CharSequence, int, TextAttribute)static classA class that holds the arguments passed to.invalid reference
#getSurroundingText(int, int, int)static interfaceA functional interface to define custom logic for getSurroundingText in tests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of arguments passed to.invalid reference
#commitText(CharSequence, int, TextAttribute)Returns the list of context menu actions performed on this input connection in the order they were received.Returns the list of editor actions performed on this input connection in the order they were received.Returns the list of key events sent to this input connection in the order they were received.Returns the list of selections sent to this input connection in the order they were received.Returns the list of arguments passed to.invalid reference
#getSurroundingText(int, int, int)voidsetSurroundingText(SurroundingText surroundingText) Sets the surrounding text to be returned by.invalid reference
#getSurroundingText(int, int, int)voidSets a custom callback to define the behavior of.invalid reference
#getSurroundingText(int, int, int)
-
Constructor Details
-
ShadowAccessibilityInputConnection
public ShadowAccessibilityInputConnection()
-
-
Method Details
-
getCommitTextArguments
Returns the list of arguments passed to.invalid reference
#commitText(CharSequence, int, TextAttribute) -
setSurroundingText
Sets the surrounding text to be returned by.invalid reference
#getSurroundingText(int, int, int) -
setSurroundingTextCallback
public void setSurroundingTextCallback(ShadowAccessibilityInputConnection.SurroundingTextCallback callback) Sets a custom callback to define the behavior of. This allows for more complex test scenarios where the returned text needs to change dynamically.invalid reference
#getSurroundingText(int, int, int) -
getSurroundingTextArguments
Returns the list of arguments passed to.invalid reference
#getSurroundingText(int, int, int) -
getContextMenuActions
Returns the list of context menu actions performed on this input connection in the order they were received. -
getEditorActions
Returns the list of editor actions performed on this input connection in the order they were received. -
getKeyEvents
Returns the list of key events sent to this input connection in the order they were received. -
getSetSelections
Returns the list of selections sent to this input connection in the order they were received. -
getDeleteSurroundingTextArguments
-