Accessibility

interface Accessibility : Variable, ScriptCloseable

无障碍服务包装接口, 用于提供无障碍服务操作.

Author

YumiMiyamoto

Functions

Link copied to clipboard
abstract fun addAccessibilityEventListener(listener: (AccessibilityEvent) -> Unit): Result

添加无障碍事件监听器

Link copied to clipboard
abstract fun addActivityChangeListener(listener: (String) -> Unit): Result

添加 Activity 变化监听器

Link copied to clipboard
abstract fun addKeyEventInterceptor(interceptor: (KeyEvent) -> Boolean): Result

添加按键事件拦截器

Link copied to clipboard
abstract fun addKeyEventListener(listener: (KeyEvent) -> Unit): Result

添加按键事件监听器

Link copied to clipboard
abstract fun addNotificationListener(listener: (Notification) -> Unit): Result

添加通知监听器

Link copied to clipboard
abstract fun addPackageChangeListener(listener: (String) -> Unit): Result

添加 app 包名变化监听器

Link copied to clipboard
abstract fun addToastListener(listener: (String, List<CharSequence>) -> Unit): Result

添加 Toast 监听器

Link copied to clipboard
abstract fun click(x: Int, y: Int, duration: Long): Boolean

在指定坐标上模拟点击.

Link copied to clipboard
abstract override fun close()
Link copied to clipboard

创建一个无障碍节点选择器, 用于选择无障碍节点

Link copied to clipboard
abstract fun dispatchGesture(points: List<Point>, duration: Long): Boolean

派遣一个手势.

Link copied to clipboard

获取界面上活跃的窗口根节点

Link copied to clipboard
abstract fun getContext(): ScriptContext
Link copied to clipboard
abstract fun getCurrentActivity(): String?

获取当前界面显示的 Activity 名

Link copied to clipboard
abstract fun getCurrentPackage(): String?

获取当前界面显示的 app 包名

Link copied to clipboard
abstract fun getGlobalName(): String
Link copied to clipboard
abstract fun getPublicType(): Type
Link copied to clipboard
abstract fun getService(): AccessibilityService?

获取无障碍服务对象

Link copied to clipboard
abstract fun isClosed(): Boolean
Link copied to clipboard
abstract fun isEnabled(): Boolean

判断无障碍服务是否启动

Link copied to clipboard
abstract fun isPrefixRequired(): Boolean
Link copied to clipboard
abstract fun isSuffixRequired(): Boolean
Link copied to clipboard
abstract fun removeAccessibilityEventListener(listener: (AccessibilityEvent) -> Unit): Result

移除无障碍事件监听器

Link copied to clipboard
abstract fun removeActivityChangeListener(listener: (String) -> Unit): Result

移除 Activity 变化监听器

Link copied to clipboard
abstract fun removeKeyEventInterceptor(interceptor: (KeyEvent) -> Boolean): Result

移除按键事件拦截器

Link copied to clipboard
abstract fun removeKeyEventListener(listener: (KeyEvent) -> Unit): Result

移除按键事件监听器

Link copied to clipboard
abstract fun removeNotificationListener(listener: (Notification) -> Unit): Result

移除通知监听器

Link copied to clipboard
abstract fun removePackageChangeListener(listener: (String) -> Unit): Result

移除 app 包名变化监听器

Link copied to clipboard
abstract fun removeToastListener(listener: (String, List<CharSequence>) -> Unit): Result

移除 Toast 监听器

Link copied to clipboard
abstract fun swipe(startX: Int, startY: Int, endX: Int, endY: Int, duration: Long): Boolean

模拟从一个点到另一个点的滑动.

Link copied to clipboard
abstract fun swipeDown(): Boolean

模拟向下滑动.

Link copied to clipboard
abstract fun swipeLeft(): Boolean

模拟向左滑动.

Link copied to clipboard
abstract fun swipeRight(): Boolean

模拟向右滑动.

Link copied to clipboard
abstract fun swipeUp(): Boolean

模拟向上滑动.