AccessibilityRecordCompat

Added in 1.1.0

class AccessibilityRecordCompat


Helper for accessing AccessibilityRecord.

Summary

Public constructors

This function is deprecated.

This is not type safe.

Public functions

Boolean
equals(obj: Any!)

This function is deprecated.

Use AccessibilityRecord directly.

Int

This function is deprecated.

Use getAddedCount directly.

CharSequence!

This function is deprecated.

Use getBeforeText directly.

CharSequence!

This function is deprecated.

Use getClassName directly.

CharSequence!

This function is deprecated.

Use getContentDescription directly.

Int

This function is deprecated.

Use getCurrentItemIndex directly.

Int

This function is deprecated.

Use getFromIndex directly.

Any!

This function is deprecated.

This method will be removed in a subsequent release of the support library.

Int

This function is deprecated.

Use getItemCount directly.

Int

This function is deprecated.

Use getMaxScrollX instead.

java-static Int
@ReplaceWith(expression = "record.getMaxScrollX()")
getMaxScrollX(record: AccessibilityRecord)

This function is deprecated.

Call getMaxScrollX directly.

Int

This function is deprecated.

Use getMaxScrollY instead.

java-static Int
@ReplaceWith(expression = "record.getMaxScrollY()")
getMaxScrollY(record: AccessibilityRecord)

This function is deprecated.

Call getMaxScrollY directly.

Parcelable!

This function is deprecated.

Use getParcelableData directly.

Int

This function is deprecated.

Use getRemovedCount directly.

Int

This function is deprecated.

Use getScrollX directly.

Int

This function is deprecated.

Use getScrollY directly.

AccessibilityNodeInfoCompat!

This function is deprecated.

Use getSource directly.

(Mutable)List<CharSequence!>!

This function is deprecated.

Use getText directly.

Int

This function is deprecated.

Use getToIndex directly.

Int

This function is deprecated.

Use getWindowId directly.

Int

This function is deprecated.

Use hashCode directly.

Boolean

This function is deprecated.

Use isChecked directly.

Boolean

This function is deprecated.

Use isEnabled directly.

Boolean

This function is deprecated.

Use isFullScreen directly.

Boolean

This function is deprecated.

Use isPassword directly.

Boolean

This function is deprecated.

Use isScrollable directly.

java-static AccessibilityRecordCompat!

This function is deprecated.

Use obtain directly.

java-static AccessibilityRecordCompat!

This function is deprecated.

Use obtain directly.

Unit

This function is deprecated.

Use recycle directly.

Unit
setAddedCount(addedCount: Int)

This function is deprecated.

Use setAddedCount directly.

Unit

This function is deprecated.

Use setBeforeText directly.

Unit
setChecked(isChecked: Boolean)

This function is deprecated.

Use setChecked directly.

Unit

This function is deprecated.

Use setClassName directly.

Unit
setContentDescription(contentDescription: CharSequence!)

This function is deprecated.

Use setContentDescription directly.

Unit
setCurrentItemIndex(currentItemIndex: Int)

This function is deprecated.

Use setCurrentItemIndex directly.

Unit
setEnabled(isEnabled: Boolean)

This function is deprecated.

Use isEnabled directly.

Unit
setFromIndex(fromIndex: Int)

This function is deprecated.

Use setFromIndex directly.

Unit
setFullScreen(isFullScreen: Boolean)

This function is deprecated.

Use setFullScreen directly.

Unit
setItemCount(itemCount: Int)

This function is deprecated.

Use setItemCount directly.

Unit
setMaxScrollX(maxScrollX: Int)

This function is deprecated.

Use setMaxScrollX instead.

java-static Unit
@ReplaceWith(expression = "record.setMaxScrollX(maxScrollX)")
setMaxScrollX(record: AccessibilityRecord, maxScrollX: Int)

This function is deprecated.

Call setMaxScrollX directly.

Unit
setMaxScrollY(maxScrollY: Int)

This function is deprecated.

Use setMaxScrollY instead.

java-static Unit
@ReplaceWith(expression = "record.setMaxScrollY(maxScrollY)")
setMaxScrollY(record: AccessibilityRecord, maxScrollY: Int)

This function is deprecated.

Call setMaxScrollY directly.

Unit
setParcelableData(parcelableData: Parcelable!)

This function is deprecated.

Use setParcelableData directly.

Unit
setPassword(isPassword: Boolean)

This function is deprecated.

Use setPassword directly.

Unit
setRemovedCount(removedCount: Int)

This function is deprecated.

Use setRemovedCount directly.

Unit
setScrollX(scrollX: Int)

This function is deprecated.

Use setScrollX directly.

Unit
setScrollY(scrollY: Int)

This function is deprecated.

Use setScrollY directly.

Unit
setScrollable(scrollable: Boolean)

This function is deprecated.

Use setScrollable directly.

Unit
setSource(source: View!)

This function is deprecated.

Use setSource directly.

Unit
setSource(root: View!, virtualDescendantId: Int)

This function is deprecated.

Use setSource instead.

java-static Unit
@ReplaceWith(expression = "record.setSource(root, virtualDescendantId)")
setSource(
    record: AccessibilityRecord,
    root: View?,
    virtualDescendantId: Int
)

This function is deprecated.

Call setSource directly.

Unit
setToIndex(toIndex: Int)

This function is deprecated.

Use setToIndex directly.

Public constructors

AccessibilityRecordCompat

Added in 1.1.0
Deprecated in 1.1.0
AccessibilityRecordCompat(record: Any!)

Public functions

equals

Added in 1.1.0
Deprecated in 1.1.0
fun equals(obj: Any!): Boolean

getAddedCount

Added in 1.1.0
Deprecated in 1.1.0
fun getAddedCount(): Int

Gets the number of added characters.

Returns
Int

The number of added characters.

getBeforeText

Added in 1.1.0
Deprecated in 1.1.0
fun getBeforeText(): CharSequence!

Sets the text before a change.

Returns
CharSequence!

The text before the change.

getClassName

Added in 1.1.0
Deprecated in 1.1.0
fun getClassName(): CharSequence!

Gets the class name of the source.

Returns
CharSequence!

The class name.

getContentDescription

Added in 1.1.0
Deprecated in 1.1.0
fun getContentDescription(): CharSequence!

Gets the description of the source.

Returns
CharSequence!

The description.

getCurrentItemIndex

Added in 1.1.0
Deprecated in 1.1.0
fun getCurrentItemIndex(): Int

Gets the index of the source in the list of items the can be visited.

Returns
Int

The current item index.

getFromIndex

Added in 1.1.0
Deprecated in 1.1.0
fun getFromIndex(): Int

Gets the index of the first character of the changed sequence, or the beginning of a text selection or the index of the first visible item when scrolling.

Returns
Int

The index of the first character or selection start or the first visible item.

getImpl

Added in 1.1.0
Deprecated in 1.1.0
fun getImpl(): Any!
Returns
Any!

The wrapped implementation.

getItemCount

Added in 1.1.0
Deprecated in 1.1.0
fun getItemCount(): Int

Gets the number of items that can be visited.

Returns
Int

The number of items.

getMaxScrollX

Added in 1.1.0
Deprecated in 1.1.0
fun getMaxScrollX(): Int

Gets the max scroll offset of the source left edge in pixels.

Returns
Int

The max scroll.

getMaxScrollX

Added in 1.1.0
Deprecated in 1.15.0
@ReplaceWith(expression = "record.getMaxScrollX()")
java-static fun getMaxScrollX(record: AccessibilityRecord): Int

Gets the max scroll offset of the source left edge in pixels.

Parameters
record: AccessibilityRecord

The AccessibilityRecord instance to use.

Returns
Int

The max scroll.

getMaxScrollY

Added in 1.1.0
Deprecated in 1.1.0
fun getMaxScrollY(): Int

Gets the max scroll offset of the source top edge in pixels.

Returns
Int

The max scroll.

getMaxScrollY

Added in 1.1.0
Deprecated in 1.15.0
@ReplaceWith(expression = "record.getMaxScrollY()")
java-static fun getMaxScrollY(record: AccessibilityRecord): Int

Gets the max scroll offset of the source top edge in pixels.

Parameters
record: AccessibilityRecord

The AccessibilityRecord instance to use.

Returns
Int

The max scroll.

getParcelableData

Added in 1.1.0
Deprecated in 1.1.0
fun getParcelableData(): Parcelable!

Gets the Parcelable data.

Returns
Parcelable!

The parcelable data.

getRemovedCount

Added in 1.1.0
Deprecated in 1.1.0
fun getRemovedCount(): Int

Gets the number of removed characters.

Returns
Int

The number of removed characters.

getScrollX

Added in 1.1.0
Deprecated in 1.1.0
fun getScrollX(): Int

Gets the scroll offset of the source left edge in pixels.

Returns
Int

The scroll.

getScrollY

Added in 1.1.0
Deprecated in 1.1.0
fun getScrollY(): Int

Gets the scroll offset of the source top edge in pixels.

Returns
Int

The scroll.

getSource

Added in 1.1.0
Deprecated in 1.1.0
fun getSource(): AccessibilityNodeInfoCompat!

Gets the AccessibilityNodeInfo of the event source.

Note: It is a client responsibility to recycle the received info by calling AccessibilityNodeInfo#recycle() to avoid creating of multiple instances.

Returns
AccessibilityNodeInfoCompat!

The info of the source.

getText

Added in 1.1.0
Deprecated in 1.1.0
fun getText(): (Mutable)List<CharSequence!>!

Gets the text of the event. The index in the list represents the priority of the text. Specifically, the lower the index the higher the priority.

Returns
(Mutable)List<CharSequence!>!

The text.

getToIndex

Added in 1.1.0
Deprecated in 1.1.0
fun getToIndex(): Int

Gets the index of text selection end or the index of the last visible item when scrolling.

Returns
Int

The index of selection end or last item index.

getWindowId

Added in 1.1.0
Deprecated in 1.1.0
fun getWindowId(): Int

Gets the id of the window from which the event comes from.

Returns
Int

The window id.

hashCode

Added in 1.1.0
Deprecated in 1.1.0
fun hashCode(): Int

isChecked

Added in 1.1.0
Deprecated in 1.1.0
fun isChecked(): Boolean

Gets if the source is checked.

Returns
Boolean

True if the view is checked, false otherwise.

isEnabled

Added in 1.1.0
Deprecated in 1.1.0
fun isEnabled(): Boolean

Gets if the source is enabled.

Returns
Boolean

True if the view is enabled, false otherwise.

isFullScreen

Added in 1.1.0
Deprecated in 1.1.0
fun isFullScreen(): Boolean

Gets if the source is taking the entire screen.

Returns
Boolean

True if the source is full screen, false otherwise.

isPassword

Added in 1.1.0
Deprecated in 1.1.0
fun isPassword(): Boolean

Gets if the source is a password field.

Returns
Boolean

True if the view is a password field, false otherwise.

isScrollable

Added in 1.1.0
Deprecated in 1.1.0
fun isScrollable(): Boolean

Gets if the source is scrollable.

Returns
Boolean

True if the source is scrollable, false otherwise.

obtain

Added in 1.1.0
Deprecated in 1.1.0
java-static fun obtain(): AccessibilityRecordCompat!

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

Returns
AccessibilityRecordCompat!

An instance.

obtain

Added in 1.1.0
Deprecated in 1.1.0
java-static fun obtain(record: AccessibilityRecordCompat!): AccessibilityRecordCompat!

Returns a cached instance if such is available or a new one is instantiated. The instance is initialized with data from the given record.

Returns
AccessibilityRecordCompat!

An instance.

recycle

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

Return an instance back to be reused.

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

Throws
java.lang.IllegalStateException

If the record is already recycled.

setAddedCount

Added in 1.1.0
Deprecated in 1.1.0
fun setAddedCount(addedCount: Int): Unit

Sets the number of added characters.

Parameters
addedCount: Int

The number of added characters.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setBeforeText

Added in 1.1.0
Deprecated in 1.1.0
fun setBeforeText(beforeText: CharSequence!): Unit

Sets the text before a change.

Parameters
beforeText: CharSequence!

The text before the change.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setChecked

Added in 1.1.0
Deprecated in 1.1.0
fun setChecked(isChecked: Boolean): Unit

Sets if the source is checked.

Parameters
isChecked: Boolean

True if the view is checked, false otherwise.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setClassName

Added in 1.1.0
Deprecated in 1.1.0
fun setClassName(className: CharSequence!): Unit

Sets the class name of the source.

Parameters
className: CharSequence!

The lass name.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setContentDescription

Added in 1.1.0
Deprecated in 1.1.0
fun setContentDescription(contentDescription: CharSequence!): Unit

Sets the description of the source.

Parameters
contentDescription: CharSequence!

The description.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setCurrentItemIndex

Added in 1.1.0
Deprecated in 1.1.0
fun setCurrentItemIndex(currentItemIndex: Int): Unit

Sets the index of the source in the list of items that can be visited.

Parameters
currentItemIndex: Int

The current item index.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setEnabled

Added in 1.1.0
Deprecated in 1.1.0
fun setEnabled(isEnabled: Boolean): Unit

Sets if the source is enabled.

Parameters
isEnabled: Boolean

True if the view is enabled, false otherwise.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setFromIndex

Added in 1.1.0
Deprecated in 1.1.0
fun setFromIndex(fromIndex: Int): Unit

Sets the index of the first character of the changed sequence or the beginning of a text selection or the index of the first visible item when scrolling.

Parameters
fromIndex: Int

The index of the first character or selection start or the first visible item.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setFullScreen

Added in 1.1.0
Deprecated in 1.1.0
fun setFullScreen(isFullScreen: Boolean): Unit

Sets if the source is taking the entire screen.

Parameters
isFullScreen: Boolean

True if the source is full screen, false otherwise.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setItemCount

Added in 1.1.0
Deprecated in 1.1.0
fun setItemCount(itemCount: Int): Unit

Sets the number of items that can be visited.

Parameters
itemCount: Int

The number of items.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setMaxScrollX

Added in 1.1.0
Deprecated in 1.1.0
fun setMaxScrollX(maxScrollX: Int): Unit

Sets the max scroll offset of the source left edge in pixels.

Parameters
maxScrollX: Int

The max scroll.

setMaxScrollX

Added in 1.1.0
Deprecated in 1.15.0
@ReplaceWith(expression = "record.setMaxScrollX(maxScrollX)")
java-static fun setMaxScrollX(record: AccessibilityRecord, maxScrollX: Int): Unit

Sets the max scroll offset of the source left edge in pixels.

Parameters
record: AccessibilityRecord

The AccessibilityRecord instance to use.

maxScrollX: Int

The max scroll.

setMaxScrollY

Added in 1.1.0
Deprecated in 1.1.0
fun setMaxScrollY(maxScrollY: Int): Unit

Sets the max scroll offset of the source top edge in pixels.

Parameters
maxScrollY: Int

The max scroll.

setMaxScrollY

Added in 1.1.0
Deprecated in 1.15.0
@ReplaceWith(expression = "record.setMaxScrollY(maxScrollY)")
java-static fun setMaxScrollY(record: AccessibilityRecord, maxScrollY: Int): Unit

Sets the max scroll offset of the source top edge in pixels.

Parameters
record: AccessibilityRecord

The AccessibilityRecord instance to use.

maxScrollY: Int

The max scroll.

setParcelableData

Added in 1.1.0
Deprecated in 1.1.0
fun setParcelableData(parcelableData: Parcelable!): Unit

Sets the Parcelable data of the event.

Parameters
parcelableData: Parcelable!

The parcelable data.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setPassword

Added in 1.1.0
Deprecated in 1.1.0
fun setPassword(isPassword: Boolean): Unit

Sets if the source is a password field.

Parameters
isPassword: Boolean

True if the view is a password field, false otherwise.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setRemovedCount

Added in 1.1.0
Deprecated in 1.1.0
fun setRemovedCount(removedCount: Int): Unit

Sets the number of removed characters.

Parameters
removedCount: Int

The number of removed characters.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setScrollX

Added in 1.1.0
Deprecated in 1.1.0
fun setScrollX(scrollX: Int): Unit

Sets the scroll offset of the source left edge in pixels.

Parameters
scrollX: Int

The scroll.

setScrollY

Added in 1.1.0
Deprecated in 1.1.0
fun setScrollY(scrollY: Int): Unit

Sets the scroll offset of the source top edge in pixels.

Parameters
scrollY: Int

The scroll.

setScrollable

Added in 1.1.0
Deprecated in 1.1.0
fun setScrollable(scrollable: Boolean): Unit

Sets if the source is scrollable.

Parameters
scrollable: Boolean

True if the source is scrollable, false otherwise.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setSource

Added in 1.1.0
Deprecated in 1.1.0
fun setSource(source: View!): Unit

Sets the event source.

Parameters
source: View!

The source.

Throws
java.lang.IllegalStateException

If called from an AccessibilityService.

setSource

Added in 1.1.0
Deprecated in 1.1.0
fun setSource(root: View!, virtualDescendantId: Int): Unit

Sets the source to be a virtual descendant of the given root. If virtualDescendantId equals to NO_ID the root is set as the source.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Parameters
root: View!

The root of the virtual subtree.

virtualDescendantId: Int

The id of the virtual descendant.

setSource

Added in 1.1.0
Deprecated in 1.15.0
@ReplaceWith(expression = "record.setSource(root, virtualDescendantId)")
java-static fun setSource(
    record: AccessibilityRecord,
    root: View?,
    virtualDescendantId: Int
): Unit

Sets the source to be a virtual descendant of the given root. If virtualDescendantId equals to NO_ID the root is set as the source.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Parameters
record: AccessibilityRecord

The AccessibilityRecord instance to use.

root: View?

The root of the virtual subtree.

virtualDescendantId: Int

The id of the virtual descendant.

setToIndex

Added in 1.1.0
Deprecated in 1.1.0
fun setToIndex(toIndex: Int): Unit

Sets the index of text selection end or the index of the last visible item when scrolling.

Parameters
toIndex: Int

The index of selection end or last item index.