Most visited

Recently visited

Added in API level 24

AccessibilityService.SoftKeyboardController

public static final class AccessibilityService.SoftKeyboardController
extends Object

java.lang.Object
   ↳ android.accessibilityservice.AccessibilityService.SoftKeyboardController


Used to control and query the soft keyboard show mode.

Summary

Nested classes

interface AccessibilityService.SoftKeyboardController.OnShowModeChangedListener

Listener for changes in the soft keyboard show mode. 

Public methods

void addOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener, Handler handler)

Adds the specified change listener to the list of soft keyboard show mode change listeners.

void addOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Adds the specified change listener to the list of show mode change listeners.

int getShowMode()

Returns the show mode of the soft keyboard.

boolean removeOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Removes all instances of the specified change listener from the list of magnification change listeners.

boolean setShowMode(int showMode)

Sets the soft keyboard show mode.

Inherited methods

From class java.lang.Object

Public methods

addOnShowModeChangedListener

Added in API level 24
void addOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener, 
                Handler handler)

Adds the specified change listener to the list of soft keyboard show mode change listeners. The callback will occur on the specified Handler's thread, or on the services's main thread if the handler is null.

Parameters
listener AccessibilityService.SoftKeyboardController.OnShowModeChangedListener: the listener to add, must be non-null
handler Handler: the handler on which to callback should execute, or null to execute on the service's main thread

addOnShowModeChangedListener

Added in API level 24
void addOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Adds the specified change listener to the list of show mode change listeners. The callback will occur on the service's main thread. Listener is not called on registration.

Parameters
listener AccessibilityService.SoftKeyboardController.OnShowModeChangedListener

getShowMode

Added in API level 24
int getShowMode ()

Returns the show mode of the soft keyboard. The default show mode is SHOW_MODE_AUTO, where the soft keyboard is shown when a text input field is focused. An AccessibilityService can also request the show mode SHOW_MODE_HIDDEN, where the soft keyboard is never shown.

Returns
int the current soft keyboard show mode

removeOnShowModeChangedListener

Added in API level 24
boolean removeOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Removes all instances of the specified change listener from the list of magnification change listeners.

Parameters
listener AccessibilityService.SoftKeyboardController.OnShowModeChangedListener: the listener to remove, must be non-null
Returns
boolean true if at least one instance of the listener was removed

setShowMode

Added in API level 24
boolean setShowMode (int showMode)

Sets the soft keyboard show mode. The default show mode is SHOW_MODE_AUTO, where the soft keyboard is shown when a text input field is focused. An AccessibilityService can also request the show mode SHOW_MODE_HIDDEN, where the soft keyboard is never shown. The The lastto this method will be honored, regardless of any previous calls (including those made by other AccessibilityServices).

Note: If the service is not yet conected (e.g. onServiceConnected() has not yet been called) or the service has been disconnected, this method will hav no effect and return false.

Parameters
showMode int: the new show mode for the soft keyboard
Returns
boolean true on success

Hooray!