AccessibilityWindowInfoCompat

Added in 1.1.0

class AccessibilityWindowInfoCompat


Helper for accessing android.view.accessibility.AccessibilityWindowInfo.

Summary

Constants

const Int

Window type: Windows that are overlaid only by an for interception of user interactions without changing the windows an accessibility service can introspect.

const Int

Window type: This is an application window.

const Int

Window type: This is an input method window.

const Int

Window type: A system window used to show the UI for the interaction with window-based magnification, which includes the magnified content and the option menu.

const Int

Window type: A system window used to divide the screen in split-screen mode.

const Int

Window type: This is an system window.

Public constructors

Creates a new AccessibilityWindowInfoCompat.

Public functions

Boolean
equals(obj: Any!)
AccessibilityNodeInfoCompat?

Gets the node that anchors this window to another.

Unit
getBoundsInScreen(outBounds: Rect)

Gets the bounds of this window in the screen.

AccessibilityWindowInfoCompat?
getChild(index: Int)

Gets the child window at a given index.

Int

Gets the number of child windows.

Int

Returns the ID of the display this window is on, for use with getDisplay.

Int

Gets the unique window id.

Int

Gets the layer which determines the Z-order of the window.

LocaleListCompat

Returns the android.os.LocaleList of the window.

AccessibilityWindowInfoCompat?

Gets the parent window if such.

Unit

Gets the touchable region of this window in the screen.

AccessibilityNodeInfoCompat?

Gets the root node in the window's hierarchy.

AccessibilityNodeInfoCompat?
getRoot(prefetchingStrategy: Int)

Gets the root node in the window's hierarchy.

CharSequence?

Gets the title of the window.

Long

Returns the uptimeMillis at which the last transition happens.

Int

Gets the type of the window.

Int
Boolean

Gets if this window has accessibility focus.

Boolean

Gets if this window is active.

Boolean

Gets if this window has input focus.

Boolean

Check if the window is in picture-in-picture mode.

java-static AccessibilityWindowInfoCompat?

Returns a cached instance if such is available or a new one is created.

java-static AccessibilityWindowInfoCompat?

Returns a cached instance if such is available or a new one is created.

Unit

This function is deprecated.

Accessibility Object recycling is no longer necessary or functional.

String
AccessibilityWindowInfo?

Constants

TYPE_ACCESSIBILITY_OVERLAY

Added in 1.1.0
const val TYPE_ACCESSIBILITY_OVERLAY = 4: Int

Window type: Windows that are overlaid only by an for interception of user interactions without changing the windows an accessibility service can introspect. In particular, an accessibility service can introspect only windows that a sighted user can interact with which they can touch these windows or can type into these windows. For example, if there is a full screen accessibility overlay that is touchable, the windows below it will be introspectable by an accessibility service regardless they are covered by a touchable window.

TYPE_APPLICATION

Added in 1.1.0
const val TYPE_APPLICATION = 1: Int

Window type: This is an application window. Such a window shows UI for interacting with an application.

TYPE_INPUT_METHOD

Added in 1.1.0
const val TYPE_INPUT_METHOD = 2: Int

Window type: This is an input method window. Such a window shows UI for inputting text such as keyboard, suggestions, etc.

TYPE_MAGNIFICATION_OVERLAY

Added in 1.12.0
const val TYPE_MAGNIFICATION_OVERLAY = 6: Int

Window type: A system window used to show the UI for the interaction with window-based magnification, which includes the magnified content and the option menu.

TYPE_SPLIT_SCREEN_DIVIDER

Added in 1.1.0
const val TYPE_SPLIT_SCREEN_DIVIDER = 5: Int

Window type: A system window used to divide the screen in split-screen mode. This type of window is present only in split-screen mode.

TYPE_SYSTEM

Added in 1.1.0
const val TYPE_SYSTEM = 3: Int

Window type: This is an system window. Such a window shows UI for interacting with the system.

Public constructors

AccessibilityWindowInfoCompat

Added in 1.12.0
AccessibilityWindowInfoCompat()

Creates a new AccessibilityWindowInfoCompat.

Compatibility:

Public functions

equals

fun equals(obj: Any!): Boolean

getAnchor

Added in 1.1.0
fun getAnchor(): AccessibilityNodeInfoCompat?

Gets the node that anchors this window to another.

Returns
AccessibilityNodeInfoCompat?

The anchor node, or null if none exists.

getBoundsInScreen

Added in 1.1.0
fun getBoundsInScreen(outBounds: Rect): Unit

Gets the bounds of this window in the screen.

Compatibility:

  • API <21: Does not operate.
Parameters
outBounds: Rect

The out window bounds.

getChild

Added in 1.1.0
fun getChild(index: Int): AccessibilityWindowInfoCompat?

Gets the child window at a given index.

Parameters
index: Int

The index.

Returns
AccessibilityWindowInfoCompat?

The child.

getChildCount

Added in 1.1.0
fun getChildCount(): Int

Gets the number of child windows.

Returns
Int

The child count.

getDisplayId

Added in 1.9.0
fun getDisplayId(): Int

Returns the ID of the display this window is on, for use with getDisplay.

Compatibility:

  • Api <33: Will return android.view.Display.DEFAULT_DISPLAY.
Returns
Int

the logical display id.

getId

Added in 1.1.0
fun getId(): Int

Gets the unique window id.

Returns
Int

windowId The window id.

getLayer

Added in 1.1.0
fun getLayer(): Int

Gets the layer which determines the Z-order of the window. Windows with greater layer appear on top of windows with lesser layer.

Returns
Int

The window layer.

getLocales

Added in 1.12.0
fun getLocales(): LocaleListCompat

Returns the android.os.LocaleList of the window.

Compatibility:

Returns
LocaleListCompat

the locales of the window.

getParent

Added in 1.1.0
fun getParent(): AccessibilityWindowInfoCompat?

Gets the parent window if such.

Returns
AccessibilityWindowInfoCompat?

The parent window.

getRegionInScreen

Added in 1.9.0
fun getRegionInScreen(outRegion: Region): Unit

Gets the touchable region of this window in the screen.

Compatibility:

  • API <33: Gets the bounds of this window in the screen.
  • API <21: Does not operate.
Parameters
outRegion: Region

The out window region.

getRoot

Added in 1.1.0
fun getRoot(): AccessibilityNodeInfoCompat?

Gets the root node in the window's hierarchy.

Returns
AccessibilityNodeInfoCompat?

The root node.

getRoot

Added in 1.12.0
fun getRoot(prefetchingStrategy: Int): AccessibilityNodeInfoCompat?

Gets the root node in the window's hierarchy.

Parameters
prefetchingStrategy: Int

the prefetching strategy.

Returns
AccessibilityNodeInfoCompat?

The root node.

See also
getParent

for a description of prefetching.

getTitle

Added in 1.1.0
fun getTitle(): CharSequence?

Gets the title of the window.

Returns
CharSequence?

The title of the window, or the application label for the window if no title was explicitly set, or null if neither is available.

getTransitionTimeMillis

Added in 1.12.0
fun getTransitionTimeMillis(): Long

Returns the uptimeMillis at which the last transition happens. A transition happens when getBoundsInScreen is changed.

Compatibility:

  • Api <34: Will return 0.
Returns
Long

The transition timestamp.

getType

Added in 1.1.0
fun getType(): Int

Gets the type of the window.

Returns
Int

The type.

hashCode

fun hashCode(): Int

isAccessibilityFocused

Added in 1.1.0
fun isAccessibilityFocused(): Boolean

Gets if this window has accessibility focus.

Returns
Boolean

Whether has accessibility focus.

isActive

Added in 1.1.0
fun isActive(): Boolean

Gets if this window is active. An active window is the one the user is currently touching or the window has input focus and the user is not touching any window.

Returns
Boolean

Whether this is the active window.

isFocused

Added in 1.1.0
fun isFocused(): Boolean

Gets if this window has input focus.

Returns
Boolean

Whether has input focus.

isInPictureInPictureMode

Added in 1.9.0
fun isInPictureInPictureMode(): Boolean

Check if the window is in picture-in-picture mode.

Compatibility:

  • API <26: Returns false.
Returns
Boolean

true if the window is in picture-in-picture mode, false otherwise.

obtain

Added in 1.1.0
java-static fun obtain(): AccessibilityWindowInfoCompat?

Returns a cached instance if such is available or a new one is created.

Returns
AccessibilityWindowInfoCompat?

An instance.

obtain

Added in 1.1.0
java-static fun obtain(info: AccessibilityWindowInfoCompat?): AccessibilityWindowInfoCompat?

Returns a cached instance if such is available or a new one is created. The returned instance is initialized from the given info.

Parameters
info: AccessibilityWindowInfoCompat?

The other info.

Returns
AccessibilityWindowInfoCompat?

An instance.

recycle

Added in 1.1.0
Deprecated in 1.10.0
fun recycle(): Unit

Return an instance back to be reused.

Note: You must not touch the object after calling this function.

toString

fun toString(): String