# ViewStructure

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# ViewStructure

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/ViewStructure "View this page in Java")  

```
abstract class ViewStructure
```

|---|----------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                           ||
| ↳ | [android.view.ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#) |

`ViewStructure`is a container for storing additional per-view data generated by[View.onProvideStructure](https://developer.android.com/reference/kotlin/android/view/View#onProvideStructure(android.view.ViewStructure))and[View.onProvideAutofillStructure](https://developer.android.com/reference/kotlin/android/view/View#onProvideAutofillStructure(android.view.ViewStructure,%20kotlin.Int)).

To learn more about using Autofill in your app, read the[Autofill Framework](https://developer.android.com/reference/kotlin/guide/topics/text/autofill)guides.

## Summary

|                                                                                            Nested classes                                                                                            ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract | [HtmlInfo](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo) Simplified representation of the HTML properties of a node that represents an HTML element. |

|                                                                                                                                                                                     Constants                                                                                                                                                                                     ||
|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_VIRTUAL_STRUCTURE_TYPE](https://developer.android.com/reference/kotlin/android/view/ViewStructure#EXTRA_VIRTUAL_STRUCTURE_TYPE:kotlin.String) Key used for writing the type of the view that generated the virtual structure of its children.                                      |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER](https://developer.android.com/reference/kotlin/android/view/ViewStructure#EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER:kotlin.String) Key used for specifying the version of the view that generated the virtual structure for itself and its children |

|                                                   Public constructors                                                    ||
|-----------------------------------------------------------------------------------------------------------------------|---|
| [ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#ViewStructure())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                             | [addChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#addChildCount(kotlin.Int))`(`num:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Add to this view's child count.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [asyncCommit](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncCommit())`()` Call when done populating a[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)returned by[asyncNewChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncNewChild(kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)!                                                                                                                                                                                                                                                           | [asyncNewChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncNewChild(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Like[newChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newChild(kotlin.Int)), but allows the caller to asynchronously populate the returned child.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [clearCredentialManagerRequest](https://developer.android.com/reference/kotlin/android/view/ViewStructure#clearCredentialManagerRequest())`()` Clears the credential request previously set through[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver))                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| abstract[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)?                                                                                                                                                                                                                                                         | [getAutofillId](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getAutofillId())`()` Gets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                             | [getChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getChildCount())`()` Return the child count as set by[setChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| abstract[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!                                                                                                                                                                                                                                                                      | [getExtras](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getExtras())`()` Get extra data associated with this view structure; the returned Bundle is mutable, allowing you to view and modify its contents.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| abstract[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                                                                                                                                                                                         | [getHint](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getHint())`()` Retrieve the last hint set by[setHint](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setHint(kotlin.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| open[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[GetCredentialResponse](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialResponse.html#)!,[GetCredentialException](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialException.html#)!\>? | [getPendingCredentialCallback](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getPendingCredentialCallback())`()` Gets the`callback`associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| open[GetCredentialRequest](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialRequest.html#)?                                                                                                                                                                                                                                     | [getPendingCredentialRequest](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getPendingCredentialRequest())`()` Gets the[GetCredentialRequest](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialRequest.html#)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| abstract[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                                                                                                                                                                                         | [getText](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getText())`()` Retrieve the last[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                             | [getTextSelectionEnd](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getTextSelectionEnd())`()` Retrieve the last selection end set by[setText(java.lang.CharSequence,int,int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| abstract[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                             | [getTextSelectionStart](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getTextSelectionStart())`()` Retrieve the last selection start set by[setText(java.lang.CharSequence,int,int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| abstract[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                                                     | [hasExtras](https://developer.android.com/reference/kotlin/android/view/ViewStructure#hasExtras())`()` Returns true if[getExtras](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getExtras())has been used to create extra content.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)!                                                                                                                                                                                                                                                           | [newChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newChild(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Create a new child[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)in this view, putting into the list of children at index.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| abstract[ViewStructure.HtmlInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo.Builder)!                                                                                                                                                                                                                          | [newHtmlInfoBuilder](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newHtmlInfoBuilder(kotlin.String))`(`tagName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a new[HtmlInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo.Builder)for the given HTML tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAccessibilityFocused](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAccessibilityFocused(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the accessibility focused state of this view, as per[View.isAccessibilityFocused()](https://developer.android.com/reference/kotlin/android/view/View#isAccessibilityFocused()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setActivated](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setActivated(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the activated state of this view, as per[View.isActivated()](https://developer.android.com/reference/kotlin/android/view/View#isActivated()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAlpha](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAlpha(kotlin.Float))`(`alpha:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Set an alpha transformation that is applied to this view, as per[View.getAlpha()](https://developer.android.com/reference/kotlin/android/view/View#getAlpha()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillHints](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillHints(kotlin.Array))`(`hint:` `[Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`)` Sets the a hints that helps the autofill service to select the appropriate data to fill the view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillId](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillId(android.view.autofill.AutofillId))`(`id:` `[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)`)` Sets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillId](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillId(android.view.autofill.AutofillId,%20kotlin.Int))`(`parentId:` `[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)`, `virtualId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)for this virtual node.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillOptions](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillOptions(kotlin.Array))`(`options:` `[Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!>!`)` Sets the options that can be used to autofill this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillType](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillType(kotlin.Int))`(`type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[View.getAutofillType()](https://developer.android.com/reference/kotlin/android/view/View#getAutofillType())that can be used to autofill this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setAutofillValue](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setAutofillValue(android.view.autofill.AutofillValue))`(`value:` `[AutofillValue](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillValue)!`)` Sets the[AutofillValue](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillValue)representing the current value of this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setCheckable](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setCheckable(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the checkable state of this view, such as whether it implements the[android.widget.Checkable](https://developer.android.com/reference/kotlin/android/widget/Checkable.html#)interface.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setChecked](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChecked(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the checked state of this view, such as[Checkable.isChecked()](https://developer.android.com/reference/kotlin/android/widget/Checkable.html#isChecked()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int))`(`num:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set the number of children of this view, which defines the range of indices you can use with[newChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newChild(kotlin.Int))and[asyncNewChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncNewChild(kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                        |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setClassName](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setClassName(kotlin.String))`(`className:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Set the class name of the view, as per[View.getAccessibilityClassName()](https://developer.android.com/reference/kotlin/android/view/View#getAccessibilityClassName()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setClickable](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setClickable(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the clickable state of this view, as per[View.isClickable()](https://developer.android.com/reference/kotlin/android/view/View#isClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setContentDescription](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setContentDescription(kotlin.CharSequence))`(`contentDescription:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Set the content description of the view, as per[View.getContentDescription()](https://developer.android.com/reference/kotlin/android/view/View#getContentDescription()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setContextClickable](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setContextClickable(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the context clickable state of this view, as per[View.isContextClickable()](https://developer.android.com/reference/kotlin/android/view/View#isContextClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setDataIsSensitive](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setDataIsSensitive(kotlin.Boolean))`(`sensitive:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc..) is striped before calls to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setDimens](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setDimens(kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`left:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `top:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `scrollX:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `scrollY:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `width:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `height:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set the basic dimensions of this view.                                                                                                                                                           |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setElevation](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setElevation(kotlin.Float))`(`elevation:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Set the visual elevation (shadow) of the view, as per[View.getZ()](https://developer.android.com/reference/kotlin/android/view/View#getZ()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setEnabled](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setEnabled(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the enabled state of this view, as per[View.isEnabled()](https://developer.android.com/reference/kotlin/android/view/View#isEnabled()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setFocusable](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setFocusable(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the focusable state of this view, as per[View.isFocusable()](https://developer.android.com/reference/kotlin/android/view/View#isFocusable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setFocused](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setFocused(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the focused state of this view, as per[View.isFocused()](https://developer.android.com/reference/kotlin/android/view/View#isFocused()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setHint](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setHint(kotlin.CharSequence))`(`hint:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Set optional hint text associated with this view; this is for example the text that is shown by an EditText when it is empty to indicate to the user the kind of text to input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setHintIdEntry](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setHintIdEntry(kotlin.String))`(`entryName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets the identifier used to set the hint associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setHtmlInfo](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setHtmlInfo(android.view.ViewStructure.HtmlInfo))`(`htmlInfo:` `[ViewStructure.HtmlInfo](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo)`)` Sets the HTML properties of this node when it represents an HTML element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setId](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setId(kotlin.Int,%20kotlin.String,%20kotlin.String,%20kotlin.String))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `packageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `typeName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `entryName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Set the identifier for this view.                                                                                                                                                                                                                                                                                                                                            |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setImportantForAutofill](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setImportantForAutofill(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[importantForAutofill mode](https://developer.android.com/reference/kotlin/android/view/View#setImportantForAutofill(kotlin.Int))of the view associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setInputType](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setInputType(kotlin.Int))`(`inputType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the[android.text.InputType](https://developer.android.com/reference/kotlin/android/text/InputType.html#)bits of this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setLocaleList](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setLocaleList(android.os.LocaleList))`(`localeList:` `[LocaleList](https://developer.android.com/reference/kotlin/android/os/LocaleList.html#)!`)` Sets the the list of locales associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setLongClickable](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setLongClickable(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the long clickable state of this view, as per[View.isLongClickable()](https://developer.android.com/reference/kotlin/android/view/View#isLongClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setMaxTextEms](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setMaxTextEms(kotlin.Int))`(`maxEms:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the maximum width in ems of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setMaxTextLength](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setMaxTextLength(kotlin.Int))`(`maxLength:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the maximum length of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setMinTextEms](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setMinTextEms(kotlin.Int))`(`minEms:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the minimum width in ems of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setOpaque](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setOpaque(kotlin.Boolean))`(`opaque:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the opaque state of this view, as per[View.isOpaque()](https://developer.android.com/reference/kotlin/android/view/View#isOpaque()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setPendingCredentialRequest](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver))`(`request:` `[GetCredentialRequest](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialRequest.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[GetCredentialResponse](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialResponse.html#)!,` `[GetCredentialException](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialException.html#)!>`)` Sets a credential request to be fired to[android.credentials.CredentialManager](https://developer.android.com/reference/kotlin/android/credentials/CredentialManager.html#)when this node is focused |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setReceiveContentMimeTypes](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setReceiveContentMimeTypes(kotlin.Array))`(`mimeTypes:` `[Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`)` Sets the MIME types accepted by this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setSelected](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setSelected(kotlin.Boolean))`(`state:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set the selected state of this view, as per[View.isSelected()](https://developer.android.com/reference/kotlin/android/view/View#isSelected()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setText](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Set the text that is associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setText](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `selectionStart:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `selectionEnd:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Like[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence))but with an active selection extending from selectionStart through selectionEnd.                                                                                                                                                                                                                                             |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                               | [setTextIdEntry](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setTextIdEntry(kotlin.String))`(`entryName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets the identifier used to set the text associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setTextLines](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setTextLines(kotlin.IntArray,%20kotlin.IntArray))`(`charOffsets:` `[IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!`, `baselines:` `[IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!`)` Set line information for test that was previously supplied through[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence)).                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setTextStyle](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setTextStyle(kotlin.Float,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`size:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `fgColor:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bgColor:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `style:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Explicitly set default global style information for text that was previously set with #setText.                                                                                                                                                                                                                                                                                               |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setTransformation](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setTransformation(android.graphics.Matrix))`(`matrix:` `[Matrix](https://developer.android.com/reference/kotlin/android/graphics/Matrix.html#)!`)` Set the transformation matrix associated with this view, as per[View.getMatrix()](https://developer.android.com/reference/kotlin/android/view/View#getMatrix()), or null if there is none.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setVisibility](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setVisibility(kotlin.Int))`(`visibility:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set the visibility state of this view, as per[View.getVisibility()](https://developer.android.com/reference/kotlin/android/view/View#getVisibility()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                           | [setWebDomain](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setWebDomain(kotlin.String))`(`domain:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets the Web domain represented by this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

## Constants

### EXTRA_VIRTUAL_STRUCTURE_TYPE

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EXTRA_VIRTUAL_STRUCTURE_TYPE: String
```

Key used for writing the type of the view that generated the virtual structure of its children.

For example, if the virtual structure is generated by a webview, the value would be "WebView". If the virtual structure is generated by a compose view, then the value would be "ComposeView". The value is of type String.

This value is added to mainly help with debugging purpose.  

    Value: "android.view.extra.VIRTUAL_STRUCTURE_TYPE"

### EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER: String
```

Key used for specifying the version of the view that generated the virtual structure for itself and its children

For example, if the virtual structure is generated by a webview of version "104.0.5112.69", then the value should be "104.0.5112.69"  

    Value: "android.view.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER"

## Public constructors

### ViewStructure

```
ViewStructure()
```

## Public methods

### addChildCount

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun addChildCount(num: Int): Int
```

Add to this view's child count. This increases the current child count by num children beyond what was last set by[setChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int))or[addChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#addChildCount(kotlin.Int)). The index at which the new child starts in the child array is returned.

|                                                      Parameters                                                      ||
|-------|---------------------------------------------------------------------------------------------------------------|
| `num` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The number of new children to add. |

|                                                                      Return                                                                       ||
|----------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Returns the index in the child array at which the new children start. |

### asyncCommit

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun asyncCommit(): Unit
```

Call when done populating a[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)returned by[asyncNewChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncNewChild(kotlin.Int)).  

### asyncNewChild

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun asyncNewChild(index: Int): ViewStructure!
```

Like[newChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newChild(kotlin.Int)), but allows the caller to asynchronously populate the returned child. It can transfer the returned[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)to another thread for it to build its content (and children etc). Once done, some thread must call[asyncCommit](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncCommit())to tell the containing[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)that the async population is done.

**NOTE:** you must pre-allocate space for the child first, by calling either[addChildCount(int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#addChildCount(kotlin.Int))or[setChildCount(int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int)).

|                                                                                                             Return                                                                                                              ||
|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)! | Returns an fresh[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)ready to be filled in. |

### clearCredentialManagerRequest

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun clearCredentialManagerRequest(): Unit
```

Clears the credential request previously set through[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver))  

### getAutofillId

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getAutofillId(): AutofillId?
```

Gets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)associated with this node.

|                                                          Return                                                          ||
|------------------------------------------------------------------------------------------------|--------------------------|
| [AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)? | This value may be`null`. |

### getChildCount

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getChildCount(): Int
```

Return the child count as set by[setChildCount](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int)).  

### getExtras

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getExtras(): Bundle!
```

Get extra data associated with this view structure; the returned Bundle is mutable, allowing you to view and modify its contents. Keys placed in the Bundle should use an appropriate namespace prefix (such as com.google.MY_KEY) to avoid conflicts.  

### getHint

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getHint(): CharSequence!
```

Retrieve the last hint set by[setHint](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setHint(kotlin.CharSequence)).  

### getPendingCredentialCallback

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getPendingCredentialCallback(): OutcomeReceiver<GetCredentialResponse!, GetCredentialException!>?
```

Gets the`callback`associated with this node.

If null, no callback or request is associated with this node, and hence no[android.credentials.CredentialManager](https://developer.android.com/reference/kotlin/android/credentials/CredentialManager.html#)request will be fired when this node is focused.

For details on how a request and callback can be set, see[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver))  

### getPendingCredentialRequest

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getPendingCredentialRequest(): GetCredentialRequest?
```

Gets the[GetCredentialRequest](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialRequest.html#)associated with this node.

If null, no request is associated with this node, and hence no[android.credentials.CredentialManager](https://developer.android.com/reference/kotlin/android/credentials/CredentialManager.html#)request will be fired when this node is focused.

For details on how a request and callback can be set, see[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver))  

### getText

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getText(): CharSequence!
```

Retrieve the last[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence)).  

### getTextSelectionEnd

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getTextSelectionEnd(): Int
```

Retrieve the last selection end set by[setText(java.lang.CharSequence,int,int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int)).  

### getTextSelectionStart

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun getTextSelectionStart(): Int
```

Retrieve the last selection start set by[setText(java.lang.CharSequence,int,int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int)).  

### hasExtras

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun hasExtras(): Boolean
```

Returns true if[getExtras](https://developer.android.com/reference/kotlin/android/view/ViewStructure#getExtras())has been used to create extra content.  

### newChild

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun newChild(index: Int): ViewStructure!
```

Create a new child[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)in this view, putting into the list of children at index.

**NOTE:** you must pre-allocate space for the child first, by calling either[addChildCount(int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#addChildCount(kotlin.Int))or[setChildCount(int)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setChildCount(kotlin.Int)).

|                                                                                                             Return                                                                                                              ||
|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)! | Returns an fresh[ViewStructure](https://developer.android.com/reference/kotlin/android/view/ViewStructure#)ready to be filled in. |

### newHtmlInfoBuilder

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun newHtmlInfoBuilder(tagName: String): ViewStructure.HtmlInfo.Builder!
```

Creates a new[HtmlInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo.Builder)for the given HTML tag.

|                                                                  Parameters                                                                   ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------|
| `tagName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):name of the HTML tag. This value cannot be`null`. |

|                                                                    Return                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------|----------------|
| [ViewStructure.HtmlInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo.Builder)! | a new builder. |

### setAccessibilityFocused

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAccessibilityFocused(state: Boolean): Unit
```

Set the accessibility focused state of this view, as per[View.isAccessibilityFocused()](https://developer.android.com/reference/kotlin/android/view/View#isAccessibilityFocused()).  

### setActivated

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setActivated(state: Boolean): Unit
```

Set the activated state of this view, as per[View.isActivated()](https://developer.android.com/reference/kotlin/android/view/View#isActivated()).  

### setAlpha

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAlpha(alpha: Float): Unit
```

Set an alpha transformation that is applied to this view, as per[View.getAlpha()](https://developer.android.com/reference/kotlin/android/view/View#getAlpha()). Value ranges from 0 (completely transparent) to 1 (completely opaque); the default is 1, which means no transformation.  

### setAutofillHints

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillHints(hint: Array<String!>?): Unit
```

Sets the a hints that helps the autofill service to select the appropriate data to fill the view.

|                                                                                              Parameters                                                                                               ||
|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `hint` | [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:This value may be`null`. |

### setAutofillId

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillId(id: AutofillId): Unit
```

Sets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)associated with this node.

|                                                           Parameters                                                            ||
|------|---------------------------------------------------------------------------------------------------------------------------|
| `id` | [AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId):This value cannot be`null`. |

### setAutofillId

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillId(
    parentId: AutofillId, 
    virtualId: Int
): Unit
```

Sets the[AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId)for this virtual node.

|                                                                                                                                             Parameters                                                                                                                                              ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `parentId`  | [AutofillId](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillId):id of the parent node. This value cannot be`null`.                                                                                                                                       |
| `virtualId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):an opaque ID to the Android System; it's the same id used on[View.autofill(android.util.SparseArray)](https://developer.android.com/reference/kotlin/android/view/View#autofill(android.util.SparseArray)). |

### setAutofillOptions

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillOptions(options: Array<CharSequence!>!): Unit
```

Sets the options that can be used to autofill this node.

Typically used by nodes whose[View.getAutofillType()](https://developer.android.com/reference/kotlin/android/view/View#getAutofillType())is a list to indicate the meaning of each possible value in the list.  

### setAutofillType

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillType(type: Int): Unit
```

Sets the[View.getAutofillType()](https://developer.android.com/reference/kotlin/android/view/View#getAutofillType())that can be used to autofill this node.

|                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                              ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.view.View#AUTOFILL_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/View#AUTOFILL_TYPE_NONE:kotlin.Int),[android.view.View#AUTOFILL_TYPE_TEXT](https://developer.android.com/reference/kotlin/android/view/View#AUTOFILL_TYPE_TEXT:kotlin.Int),[android.view.View#AUTOFILL_TYPE_TOGGLE](https://developer.android.com/reference/kotlin/android/view/View#AUTOFILL_TYPE_TOGGLE:kotlin.Int),[android.view.View#AUTOFILL_TYPE_LIST](https://developer.android.com/reference/kotlin/android/view/View#AUTOFILL_TYPE_LIST:kotlin.Int), or[android.view.View#AUTOFILL_TYPE_DATE](https://developer.android.com/reference/kotlin/android/view/View#AUTOFILL_TYPE_DATE:kotlin.Int) |

### setAutofillValue

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setAutofillValue(value: AutofillValue!): Unit
```

Sets the[AutofillValue](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillValue)representing the current value of this node.  

### setCheckable

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setCheckable(state: Boolean): Unit
```

Set the checkable state of this view, such as whether it implements the[android.widget.Checkable](https://developer.android.com/reference/kotlin/android/widget/Checkable.html#)interface.  

### setChecked

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setChecked(state: Boolean): Unit
```

Set the checked state of this view, such as[Checkable.isChecked()](https://developer.android.com/reference/kotlin/android/widget/Checkable.html#isChecked()).  

### setChildCount

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setChildCount(num: Int): Unit
```

Set the number of children of this view, which defines the range of indices you can use with[newChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#newChild(kotlin.Int))and[asyncNewChild](https://developer.android.com/reference/kotlin/android/view/ViewStructure#asyncNewChild(kotlin.Int)). Calling this method again resets all of the child state of the view, removing any children that had previously been added.  

### setClassName

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setClassName(className: String!): Unit
```

Set the class name of the view, as per[View.getAccessibilityClassName()](https://developer.android.com/reference/kotlin/android/view/View#getAccessibilityClassName()).  

### setClickable

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setClickable(state: Boolean): Unit
```

Set the clickable state of this view, as per[View.isClickable()](https://developer.android.com/reference/kotlin/android/view/View#isClickable()).  

### setContentDescription

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setContentDescription(contentDescription: CharSequence!): Unit
```

Set the content description of the view, as per[View.getContentDescription()](https://developer.android.com/reference/kotlin/android/view/View#getContentDescription()).  

### setContextClickable

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setContextClickable(state: Boolean): Unit
```

Set the context clickable state of this view, as per[View.isContextClickable()](https://developer.android.com/reference/kotlin/android/view/View#isContextClickable()).  

### setDataIsSensitive

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setDataIsSensitive(sensitive: Boolean): Unit
```

Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc..) is striped before calls to[android.service.autofill.AutofillService#onFillRequest(android.service.autofill.FillRequest, * android.os.CancellationSignal, android.service.autofill.FillCallback)](https://developer.android.com/reference/kotlin/android/service/autofill/AutofillService.html#onFillRequest(android.service.autofill.FillRequest,%20android.os.CancellationSignal,%20android.service.autofill.FillCallback)).

By default, all nodes are assumed to be sensitive, and only nodes that does not have PII (Personally Identifiable Information - sensitive data such as email addresses, credit card numbers, passwords, etc...) should be marked as non-sensitive; a good rule of thumb is to mark as non-sensitive nodes whose value were statically set from resources.

Notice that the content of even sensitive nodes are sent to the service (through the[android.service.autofill.AutofillService#onSaveRequest(android.service.autofill.SaveRequest, * android.service.autofill.SaveCallback)](https://developer.android.com/reference/kotlin/android/service/autofill/AutofillService.html#onSaveRequest(android.service.autofill.SaveRequest,%20android.service.autofill.SaveCallback))call) when the user consented to save thedata, so it is important to set the content of sensitive nodes as well, but mark them as sensitive.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.  

### setDimens

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract 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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The view's left position, in pixels relative to its parent's left edge.                                                     |
| `top`     | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The view's top position, in pixels relative to its parent's top edge.                                                       |
| `scrollX` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):How much the view's x coordinate space has been scrolled, in pixels.                                                        |
| `scrollY` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):How much the view's y coordinate space has been scrolled, in pixels.                                                        |
| `width`   | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The view's visible height, in pixels. This is the height visible on screen, not the total data height of a scrollable view. |

### setElevation

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setElevation(elevation: Float): Unit
```

Set the visual elevation (shadow) of the view, as per[View.getZ()](https://developer.android.com/reference/kotlin/android/view/View#getZ()). Note this is*not*related to the physical Z-ordering of this view relative to its other siblings (that is how they overlap when drawing), it is only the visual representation for shadowing.  

### setEnabled

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setEnabled(state: Boolean): Unit
```

Set the enabled state of this view, as per[View.isEnabled()](https://developer.android.com/reference/kotlin/android/view/View#isEnabled()).  

### setFocusable

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setFocusable(state: Boolean): Unit
```

Set the focusable state of this view, as per[View.isFocusable()](https://developer.android.com/reference/kotlin/android/view/View#isFocusable()).  

### setFocused

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setFocused(state: Boolean): Unit
```

Set the focused state of this view, as per[View.isFocused()](https://developer.android.com/reference/kotlin/android/view/View#isFocused()).  

### setHint

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setHint(hint: CharSequence!): Unit
```

Set optional hint text associated with this view; this is for example the text that is shown by an EditText when it is empty to indicate to the user the kind of text to input.  

### setHintIdEntry

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setHintIdEntry(entryName: String): Unit
```

Sets the identifier used to set the hint associated with this view.

Used as metadata for fingerprinting view nodes/structures.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

|                                                        Parameters                                                         ||
|-------------|--------------------------------------------------------------------------------------------------------------|
| `entryName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

### setHtmlInfo

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setHtmlInfo(htmlInfo: ViewStructure.HtmlInfo): Unit
```

Sets the HTML properties of this node when it represents an HTML element.

Should only be set when the node is used for autofill purposes - it will be ignored when used for assist.

|                                                                              Parameters                                                                               ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `htmlInfo` | [ViewStructure.HtmlInfo](https://developer.android.com/reference/kotlin/android/view/ViewStructure.HtmlInfo):HTML properties. This value cannot be`null`. |

### setId

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setId(
    id: Int, 
    packageName: String!, 
    typeName: String!, 
    entryName: String!
): Unit
```

Set the identifier for this view.

|                                                                                                    Parameters                                                                                                    ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id`          | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The view's identifier, as per[View.getId()](https://developer.android.com/reference/kotlin/android/view/View#getId()). |
| `packageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The package name of the view's identifier, or null if there is none.                                            |
| `typeName`    | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The type name of the view's identifier, or null if there is none.                                               |
| `entryName`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The entry name of the view's identifier, or null if there is none.                                              |

### setImportantForAutofill

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setImportantForAutofill(mode: Int): Unit
```

Sets the[importantForAutofill mode](https://developer.android.com/reference/kotlin/android/view/View#setImportantForAutofill(kotlin.Int))of the view associated with this node.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.view.View#IMPORTANT_FOR_AUTOFILL_AUTO](https://developer.android.com/reference/kotlin/android/view/View#IMPORTANT_FOR_AUTOFILL_AUTO:kotlin.Int),[android.view.View#IMPORTANT_FOR_AUTOFILL_YES](https://developer.android.com/reference/kotlin/android/view/View#IMPORTANT_FOR_AUTOFILL_YES:kotlin.Int),[android.view.View#IMPORTANT_FOR_AUTOFILL_NO](https://developer.android.com/reference/kotlin/android/view/View#IMPORTANT_FOR_AUTOFILL_NO:kotlin.Int),[android.view.View#IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS](https://developer.android.com/reference/kotlin/android/view/View#IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS:kotlin.Int), or[android.view.View#IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS](https://developer.android.com/reference/kotlin/android/view/View#IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS:kotlin.Int) |

### setInputType

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setInputType(inputType: Int): Unit
```

Sets the[android.text.InputType](https://developer.android.com/reference/kotlin/android/text/InputType.html#)bits of this node.

|                                                                                                         Parameters                                                                                                         ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `inputType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):inputType bits as defined by[android.text.InputType](https://developer.android.com/reference/kotlin/android/text/InputType.html#). |

### setLocaleList

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setLocaleList(localeList: LocaleList!): Unit
```

Sets the the list of locales associated with this node.  

### setLongClickable

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setLongClickable(state: Boolean): Unit
```

Set the long clickable state of this view, as per[View.isLongClickable()](https://developer.android.com/reference/kotlin/android/view/View#isLongClickable()).  

### setMaxTextEms

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setMaxTextEms(maxEms: Int): Unit
```

Sets the maximum width in ems of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.  

### setMaxTextLength

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setMaxTextLength(maxLength: Int): Unit
```

Sets the maximum length of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.  

### setMinTextEms

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setMinTextEms(minEms: Int): Unit
```

Sets the minimum width in ems of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.  

### setOpaque

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setOpaque(opaque: Boolean): Unit
```

Set the opaque state of this view, as per[View.isOpaque()](https://developer.android.com/reference/kotlin/android/view/View#isOpaque()).  

### setPendingCredentialRequest

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setPendingCredentialRequest(
    request: GetCredentialRequest, 
    callback: OutcomeReceiver<GetCredentialResponse!, GetCredentialException!>
): Unit
```

Sets a credential request to be fired to[android.credentials.CredentialManager](https://developer.android.com/reference/kotlin/android/credentials/CredentialManager.html#)when this node is focused

|                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                          ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `request`  | [GetCredentialRequest](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialRequest.html#):the request to be fired This value cannot be`null`.                                                                                                                                                                                                                                                                       |
| `callback` | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[GetCredentialResponse](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialResponse.html#)!,[GetCredentialException](https://developer.android.com/reference/kotlin/android/credentials/GetCredentialException.html#)!\>:the callback where the response or exception, is returned This value cannot be`null`. |

### setReceiveContentMimeTypes

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setReceiveContentMimeTypes(mimeTypes: Array<String!>?): Unit
```

Sets the MIME types accepted by this view. See[View.getReceiveContentMimeTypes()](https://developer.android.com/reference/kotlin/android/view/View#getReceiveContentMimeTypes()).

Should only be set when the node is used for Autofill or Content Capture purposes - it will be ignored when used for Assist.

|                                                                                                 Parameters                                                                                                 ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mimeTypes` | [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:This value may be`null`. |

### setSelected

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setSelected(state: Boolean): Unit
```

Set the selected state of this view, as per[View.isSelected()](https://developer.android.com/reference/kotlin/android/view/View#isSelected()).  

### setText

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setText(text: 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.  

### setText

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setText(
    text: CharSequence!, 
    selectionStart: Int, 
    selectionEnd: Int
): Unit
```

Like[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence))but with an active selection extending from selectionStart through selectionEnd.  

### setTextIdEntry

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setTextIdEntry(entryName: String): Unit
```

Sets the identifier used to set the text associated with this view.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

|                                                        Parameters                                                         ||
|-------------|--------------------------------------------------------------------------------------------------------------|
| `entryName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

### setTextLines

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setTextLines(
    charOffsets: IntArray!, 
    baselines: IntArray!
): Unit
```

Set line information for test that was previously supplied through[setText(java.lang.CharSequence)](https://developer.android.com/reference/kotlin/android/view/ViewStructure#setText(kotlin.CharSequence)). This provides the line breaking of the text as it is shown on screen. This function takes ownership of the provided arrays; you should not make further modification to them.

|                                                                      Parameters                                                                       ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `charOffsets` | [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!:The offset in to #setText where a line starts.  |
| `baselines`   | [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!:The baseline where the line is drawn on screen. |

### setTextStyle

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setTextStyle(
    size: Float, 
    fgColor: Int, 
    bgColor: Int, 
    style: Int
): Unit
```

Explicitly set default global style information for text that was previously set with #setText.

|                                                                                                                            Parameters                                                                                                                            ||
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `size`    | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):The size, in pixels, of the text.                                                                                                                                      |
| `fgColor` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The foreground color, packed as 0xAARRGGBB.                                                                                                                                |
| `bgColor` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The background color, packed as 0xAARRGGBB.                                                                                                                                |
| `style`   | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Style flags, as defined by[android.app.assist.AssistStructure.ViewNode](https://developer.android.com/reference/kotlin/android/app/assist/AssistStructure.ViewNode.html#). |

### setTransformation

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setTransformation(matrix: Matrix!): Unit
```

Set the transformation matrix associated with this view, as per[View.getMatrix()](https://developer.android.com/reference/kotlin/android/view/View#getMatrix()), or null if there is none.  

### setVisibility

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setVisibility(visibility: Int): Unit
```

Set the visibility state of this view, as per[View.getVisibility()](https://developer.android.com/reference/kotlin/android/view/View#getVisibility()).  

### setWebDomain

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun setWebDomain(domain: String?): Unit
```

Sets the Web domain represented by this node.

Typically used when the view is a container for an HTML document.

|                                                                              Parameters                                                                              ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `domain` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:RFC 2396-compliant URI representing the domain. This value may be`null`. |