Most visited

Recently visited

Added in API level 4

AccessibilityManager

public final class AccessibilityManager
extends Object

java.lang.Object
   ↳ android.view.accessibility.AccessibilityManager


系统级服务,用作AccessibilityEvent的事件分派,并提供查询系统可访问性状态的工具。 当用户界面中出现显着事件时会生成可访问性事件,例如Activity开始,焦点或选择View发生变化等。对处理可访问性事件感兴趣的各方实施和注册可扩展性为AccessibilityService的可访问性服务。

要获取无障碍管理器的句柄,请执行以下操作:

AccessibilityManager accessibilityManager =
        (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

也可以看看:

Summary

Nested classes

interface AccessibilityManager.AccessibilityStateChangeListener

系统可访问性状态的监听器。

interface AccessibilityManager.TouchExplorationStateChangeListener

系统触摸探索状态的侦听器。

Public methods

boolean addAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListener listener)

注册 AccessibilityManager.AccessibilityStateChangeListener以更改系统的全局可访问状态。

boolean addTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListener listener)

注册一个 AccessibilityManager.TouchExplorationStateChangeListener用于更改系统的全局触摸探索状态。

List<ServiceInfo> getAccessibilityServiceList()

此方法在API级别14中已弃用。使用getInstalledAccessibilityServiceList()

List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(int feedbackTypeFlags)

针对给定的反馈类型返回启用的辅助功能服务的 AccessibilityServiceInfo

List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList()

返回已安装无障碍服务的 AccessibilityServiceInfo

void interrupt()

请求来自所有无障碍服务的反馈中断。

boolean isEnabled()

返回系统中的辅助功能是否启用。

boolean isTouchExplorationEnabled()

如果系统中的触摸浏览已启用,则返回。

boolean removeAccessibilityStateChangeListener(AccessibilityManager.AccessibilityStateChangeListener listener)

取消注册 AccessibilityManager.AccessibilityStateChangeListener

boolean removeTouchExplorationStateChangeListener(AccessibilityManager.TouchExplorationStateChangeListener listener)

取消注册 AccessibilityManager.TouchExplorationStateChangeListener

void sendAccessibilityEvent(AccessibilityEvent event)

发送 AccessibilityEvent

Inherited methods

From class java.lang.Object

Public methods

addAccessibilityStateChangeListener

Added in API level 14
boolean addAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

注册一个 AccessibilityManager.AccessibilityStateChangeListener以更改系统的全局可访问状态。

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully registered.

addTouchExplorationStateChangeListener

Added in API level 19
boolean addTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

注册一个 AccessibilityManager.TouchExplorationStateChangeListener用于更改系统的全局触摸探索状态。

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully registered.

getAccessibilityServiceList

Added in API level 4
List<ServiceInfo> getAccessibilityServiceList ()

此方法在API级别14中已弃用。
使用getInstalledAccessibilityServiceList()

返回已安装无障碍服务的 ServiceInfo

Returns
List<ServiceInfo> An unmodifiable list with ServiceInfos.

getEnabledAccessibilityServiceList

Added in API level 14
List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList (int feedbackTypeFlags)

针对给定的反馈类型返回启用的辅助功能服务的 AccessibilityServiceInfo

Parameters
feedbackTypeFlags int: The feedback type flags.
Returns
List<AccessibilityServiceInfo> An unmodifiable list with AccessibilityServiceInfos.

也可以看看:

getInstalledAccessibilityServiceList

Added in API level 14
List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList ()

返回已安装无障碍服务的 AccessibilityServiceInfo

Returns
List<AccessibilityServiceInfo> An unmodifiable list with AccessibilityServiceInfos.

interrupt

Added in API level 4
void interrupt ()

请求来自所有无障碍服务的反馈中断。

isEnabled

Added in API level 4
boolean isEnabled ()

返回系统中的辅助功能是否启用。

Returns
boolean True if accessibility is enabled, false otherwise.

isTouchExplorationEnabled

Added in API level 14
boolean isTouchExplorationEnabled ()

如果系统中的触摸浏览已启用,则返回。

Returns
boolean True if touch exploration is enabled, false otherwise.

removeAccessibilityStateChangeListener

Added in API level 14
boolean removeAccessibilityStateChangeListener (AccessibilityManager.AccessibilityStateChangeListener listener)

取消注册 AccessibilityManager.AccessibilityStateChangeListener

Parameters
listener AccessibilityManager.AccessibilityStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

removeTouchExplorationStateChangeListener

Added in API level 19
boolean removeTouchExplorationStateChangeListener (AccessibilityManager.TouchExplorationStateChangeListener listener)

取消注册 AccessibilityManager.TouchExplorationStateChangeListener

Parameters
listener AccessibilityManager.TouchExplorationStateChangeListener: The listener.
Returns
boolean True if successfully unregistered.

sendAccessibilityEvent

Added in API level 4
void sendAccessibilityEvent (AccessibilityEvent event)

发送 AccessibilityEvent

Parameters
event AccessibilityEvent: The event to send.
Throws
IllegalStateException if accessibility is not enabled. Note: The preferred mechanism for sending custom accessibility events is through calling requestSendAccessibilityEvent(View, AccessibilityEvent) instead of this method to allow predecessors to augment/filter events sent by their descendants.

Hooray!