ViewStructureCompat


class ViewStructureCompat


Helper for accessing features in ViewStructure.

Currently this helper class only has features for content capture usage. Other features for Autofill are not available.

Summary

Public functions

Unit

Set the class name of the view, as per View.getAccessibilityClassName().

Unit

Set the content description of the view, as per View.getContentDescription().

Unit
setDimens(
    left: Int,
    top: Int,
    scrollX: Int,
    scrollY: Int,
    width: Int,
    height: Int
)

Set the basic dimensions of this view.

Unit
setText(charSequence: CharSequence)

Set the text that is associated with this view.

ViewStructure

Provides the ViewStructure represented by this object.

java-static ViewStructureCompat
toViewStructureCompat(contentCaptureSession: ViewStructure)

Provides a backward-compatible wrapper for ViewStructure.

Public functions

setClassName

Added in 1.11.0
fun setClassName(string: String): Unit

Set the class name of the view, as per View.getAccessibilityClassName().

setContentDescription

Added in 1.11.0
fun setContentDescription(charSequence: CharSequence): Unit

Set the content description of the view, as per View.getContentDescription().

setDimens

Added in 1.11.0
fun setDimens(
    left: Int,
    top: Int,
    scrollX: Int,
    scrollY: Int,
    width: Int,
    height: Int
): Unit

Set the basic dimensions of this view.

Parameters
left: Int

The view's left position, in pixels relative to its parent's left edge.

top: Int

The view's top position, in pixels relative to its parent's top edge.

scrollX: Int

How much the view's x coordinate space has been scrolled, in pixels.

scrollY: Int

How much the view's y coordinate space has been scrolled, in pixels.

width: Int

The view's visible width, in pixels. This is the width visible on screen, not the total data width of a scrollable view.

height: Int

The view's visible height, in pixels. This is the height visible on screen, not the total data height of a scrollable view.

setText

Added in 1.11.0
fun setText(charSequence: CharSequence): Unit

Set the text that is associated with this view. There is no selection associated with the text. The text may have style spans to supply additional display and semantic information.

toViewStructure

Added in 1.11.0
fun toViewStructure(): ViewStructure

Provides the ViewStructure represented by this object.

Returns
ViewStructure

platform class object

toViewStructureCompat

Added in 1.11.0
java-static fun toViewStructureCompat(contentCaptureSession: ViewStructure): ViewStructureCompat

Provides a backward-compatible wrapper for ViewStructure.

Parameters
contentCaptureSession: ViewStructure

platform class to wrap

Returns
ViewStructureCompat

wrapped class