ViewNode
open class ViewNode
kotlin.Any | |
↳ | android.app.assist.AssistStructure.ViewNode |
Describes a single view in the assist data.
Summary
Constants | |
---|---|
static Int |
Magic value for text color that has not been defined, which is very unlikely to be confused with a real text color. |
static Int | |
static Int | |
static Int | |
static Int |
Public methods | |
---|---|
open Float |
getAlpha() Returns the alpha transformation of the view, used to reduce the overall opacity of the view's contents, as set by |
open Array<String!>? |
Describes the content of a view so that a autofill service can fill in the appropriate data. |
open AutofillId? |
Gets the id that can be used to autofill the view contents. |
open Array<CharSequence!>? |
Gets the options that can be used to autofill this view. |
open Int |
Gets the type of value that can be used to autofill the view contents. |
open AutofillValue? |
Gets the value of this view. |
open AssistStructure.ViewNode! |
getChildAt(index: Int) Return a child of this node, given an index value from 0 to |
open Int |
Return the number of children this node has. |
open String? |
Returns the class name of the node's implementation, indicating its behavior. |
open CharSequence? |
Returns any content description associated with the node, which semantically describes its purpose for accessibility and other uses. |
open Float |
Returns the visual elevation of the view, used for shadowing and other visual characterstics, as set by |
open Bundle? |
Return a Bundle containing optional vendor-specific extension information. |
open Int |
Returns the height of this view, in pixels. |
open String? |
getHint() Return additional hint text associated with the node; this is typically used with a node that takes user input, describing to the user what the input means. |
open String? |
Gets the identifier used to set the hint associated with this view. |
open ViewStructure.HtmlInfo? |
Returns the HTML properties associated with this view. |
open Int |
getId() Returns the ID associated with this view, as per |
open String? |
If |
open String? |
If |
open String? |
If |
open Int |
Gets the |
open Int |
Gets the |
open Int |
getLeft() Returns the left edge of this view, in pixels, relative to the left edge of its parent. |
open LocaleList? |
Returns the list of locales associated with this view. |
open Int |
Returns the maximum width in ems of the text associated with this node, or |
open Int |
Returns the maximum length of the text associated with this node, or |
open Int |
Returns the minimum width in ems of the text associated with this node, or |
open Array<String!>? |
Returns the MIME types accepted by |
open Int |
Returns the current X scroll offset of this view, as per |
open Int |
Returns the current Y scroll offset of this view, as per |
open CharSequence? |
getText() Returns any text associated with the node that is displayed to the user, or null if there is none. |
open Int |
If |
open Int |
If |
open String? |
Gets the identifier used to set the text associated with this view. |
open IntArray? |
Return per-line baselines into the text returned by |
open IntArray? |
Return per-line offsets into the text returned by |
open Int |
If |
open Int |
If |
open Float |
If |
open Int |
If |
open Int |
getTop() Returns the top edge of this view, in pixels, relative to the top edge of its parent. |
open Matrix! |
Returns the transformation that has been applied to this view, such as a translation or scaling. |
open Int |
Returns the visibility mode of this view, as per |
open String? |
Returns the domain of the HTML document represented by this view. |
open String? |
Returns the scheme of the HTML document represented by this view. |
open Int |
getWidth() Returns the width of this view, in pixels. |
open Boolean |
Returns true if this node currently had accessibility focus at the time that the structure was collected. |
open Boolean |
Returns true if this node has currently been activated by the user. |
open Boolean |
Returns true if assist data has been blocked starting at this node in the hierarchy. |
open Boolean |
Returns true if this node represents something that is checkable by the user. |
open Boolean |
Returns true if this node is currently in a checked state. |
open Boolean |
Returns true if this node is clickable by the user. |
open Boolean |
Returns true if this node is something the user can perform a context click on. |
open Boolean |
Returns true if this node is in an enabled state. |
open Boolean |
Returns true if this node can take input focus. |
open Boolean |
Returns true if this node currently had input focus at the time that the structure was collected. |
open Boolean |
Returns true if this node is something the user can perform a long click/press on. |
open Boolean |
isOpaque() Returns true if this node is opaque. |
open Boolean |
Returns true if this node has currently been selected by the user. |
Constants
TEXT_COLOR_UNDEFINED
static val TEXT_COLOR_UNDEFINED: Int
Magic value for text color that has not been defined, which is very unlikely to be confused with a real text color.
Value: 1
Public methods
getAlpha
open fun getAlpha(): Float
Returns the alpha transformation of the view, used to reduce the overall opacity of the view's contents, as set by ViewStructure.setAlpha(float)
.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getAutofillHints
open fun getAutofillHints(): Array<String!>?
Describes the content of a view so that a autofill service can fill in the appropriate data.
It's only relevant when the AssistStructure
is used for autofill purposes, not for Assist - see View.getAutofillHints()
for more info.
Return | |
---|---|
Array<String!>? |
The autofill hints for this view, or null if the structure was created for assist purposes. |
getAutofillId
open fun getAutofillId(): AutofillId?
Gets the id that can be used to autofill the view contents.
It's only relevant when the AssistStructure
is used for autofill purposes.
Return | |
---|---|
AutofillId? |
id that can be used to autofill the view contents, or null if the structure was created for assist purposes. |
getAutofillOptions
open fun getAutofillOptions(): Array<CharSequence!>?
Gets the options that can be used to autofill this view.
Typically used by nodes whose View.getAutofillType()
is a list to indicate the meaning of each possible value in the list.
It's relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
Return | |
---|---|
Array<CharSequence!>? |
the options that can be used to autofill this view, or null if the structure was created for assist purposes. |
getAutofillType
open fun getAutofillType(): Int
Gets the type of value that can be used to autofill the view contents.
It's only relevant when the AssistStructure
is used for autofill purposes.
Return | |
---|---|
Int |
autofill type as defined by View.getAutofillType() , or View.AUTOFILL_TYPE_NONE if the structure was created for assist purposes. Value is android.view.View#AUTOFILL_TYPE_NONE , android.view.View#AUTOFILL_TYPE_TEXT , android.view.View#AUTOFILL_TYPE_TOGGLE , android.view.View#AUTOFILL_TYPE_LIST , or android.view.View#AUTOFILL_TYPE_DATE |
getAutofillValue
open fun getAutofillValue(): AutofillValue?
Gets the value of this view.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
Return | |
---|---|
AutofillValue? |
the autofill value of this view, or null if the structure was created for assist purposes. |
getChildAt
open fun getChildAt(index: Int): AssistStructure.ViewNode!
Return a child of this node, given an index value from 0 to getChildCount()
-1.
getChildCount
open fun getChildCount(): Int
Return the number of children this node has.
getClassName
open fun getClassName(): String?
Returns the class name of the node's implementation, indicating its behavior. For example, a button will report "android.widget.Button" meaning it behaves like a android.widget.Button
.
Return | |
---|---|
String? |
This value may be null . |
getContentDescription
open fun getContentDescription(): CharSequence?
Returns any content description associated with the node, which semantically describes its purpose for accessibility and other uses.
Return | |
---|---|
CharSequence? |
This value may be null . |
getElevation
open fun getElevation(): Float
Returns the visual elevation of the view, used for shadowing and other visual characterstics, as set by ViewStructure.setElevation(float)
.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getExtras
open fun getExtras(): Bundle?
Return a Bundle containing optional vendor-specific extension information.
Return | |
---|---|
Bundle? |
This value may be null . |
getHeight
open fun getHeight(): Int
Returns the height of this view, in pixels.
getHint
open fun getHint(): String?
Return additional hint text associated with the node; this is typically used with a node that takes user input, describing to the user what the input means.
Return | |
---|---|
String? |
This value may be null . |
getHintIdEntry
open fun getHintIdEntry(): String?
Gets the identifier used to set the hint associated with this view.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
Return | |
---|---|
String? |
This value may be null . |
getHtmlInfo
open fun getHtmlInfo(): ViewStructure.HtmlInfo?
Returns the HTML properties associated with this view.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
Return | |
---|---|
ViewStructure.HtmlInfo? |
the HTML properties associated with this view, or null if the structure was created for assist purposes. |
getId
open fun getId(): Int
Returns the ID associated with this view, as per View.getId()
.
getIdEntry
open fun getIdEntry(): String?
If getId()
is a resource identifier, this is the entry name of that identifier. See ViewStructure.setId
for more information.
Return | |
---|---|
String? |
This value may be null . |
getIdPackage
open fun getIdPackage(): String?
If getId()
is a resource identifier, this is the package name of that identifier. See ViewStructure.setId
for more information.
Return | |
---|---|
String? |
This value may be null . |
getIdType
open fun getIdType(): String?
If getId()
is a resource identifier, this is the type name of that identifier. See ViewStructure.setId
for more information.
Return | |
---|---|
String? |
This value may be null . |
getImportantForAutofill
open fun getImportantForAutofill(): Int
Gets the importantForAutofill mode
of the view associated with this node.
It's only relevant when the AssistStructure
is used for autofill purposes.
getInputType
open fun getInputType(): Int
Gets the android.text.InputType
bits of this structure.
Return | |
---|---|
Int |
bits as defined by android.text.InputType . |
getLeft
open fun getLeft(): Int
Returns the left edge of this view, in pixels, relative to the left edge of its parent.
getLocaleList
open fun getLocaleList(): LocaleList?
Returns the list of locales associated with this view.
Return | |
---|---|
LocaleList? |
This value may be null . |
getMaxTextEms
open fun getMaxTextEms(): Int
Returns the maximum width in ems of the text associated with this node, or -1
if not supported by the node.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
getMaxTextLength
open fun getMaxTextLength(): Int
Returns the maximum length of the text associated with this node, or -1
if not supported by the node or not set. System may set a default value if the text length is not set.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
getMinTextEms
open fun getMinTextEms(): Int
Returns the minimum width in ems of the text associated with this node, or -1
if not supported by the node.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
getReceiveContentMimeTypes
open fun getReceiveContentMimeTypes(): Array<String!>?
Returns the MIME types accepted by View.performReceiveContent
for this view. See View.getReceiveContentMimeTypes()
for details.
Return | |
---|---|
Array<String!>? |
This value may be null . |
getScrollX
open fun getScrollX(): Int
Returns the current X scroll offset of this view, as per View.getScrollX()
.
getScrollY
open fun getScrollY(): Int
Returns the current Y scroll offset of this view, as per View.getScrollY()
.
getText
open fun getText(): CharSequence?
Returns any text associated with the node that is displayed to the user, or null if there is none.
The text will be stripped of any spans that could potentially contain reference to the activity context, to avoid memory leak. If the text contained a span, a plain string version of the text will be returned.
getTextBackgroundColor
open fun getTextBackgroundColor(): Int
If getText()
is non-null, this is the main text background color associated with it. If there is no text background color, TEXT_COLOR_UNDEFINED
is returned. Note that the text may also contain style spans that modify the color of specific parts of the text.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextColor
open fun getTextColor(): Int
If getText()
is non-null, this is the main text color associated with it. If there is no text color, TEXT_COLOR_UNDEFINED
is returned. Note that the text may also contain style spans that modify the color of specific parts of the text.
getTextIdEntry
open fun getTextIdEntry(): String?
Gets the identifier used to set the text associated with this view.
It's only relevant when the AssistStructure
is used for autofill purposes, not for assist purposes.
Return | |
---|---|
String? |
This value may be null . |
getTextLineBaselines
open fun getTextLineBaselines(): IntArray?
Return per-line baselines into the text returned by getText()
. Each entry in the array is a formatted line of text, and the value it contains is the baseline where that text appears in the view. May return null if there is no line information.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextLineCharOffsets
open fun getTextLineCharOffsets(): IntArray?
Return per-line offsets into the text returned by getText()
. Each entry in the array is a formatted line of text, and the value it contains is the offset into the text string where that line starts. May return null if there is no line information.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextSelectionEnd
open fun getTextSelectionEnd(): Int
If getText()
is non-null, this is where the current selection starts. If there is no selection, returns the same value as getTextSelectionStart()
, indicating the cursor position.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextSelectionStart
open fun getTextSelectionStart(): Int
If getText()
is non-null, this is where the current selection starts.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextSize
open fun getTextSize(): Float
If getText()
is non-null, this is the main text size (in pixels) associated with it. Note that the text may also contain style spans that modify the size of specific parts of the text.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTextStyle
open fun getTextStyle(): Int
If getText()
is non-null, this is the main text style associated with it, containing a bit mask of TEXT_STYLE_BOLD
, TEXT_STYLE_BOLD
, TEXT_STYLE_STRIKE_THRU
, and/or TEXT_STYLE_UNDERLINE
. Note that the text may also contain style spans that modify the style of specific parts of the text.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getTop
open fun getTop(): Int
Returns the top edge of this view, in pixels, relative to the top edge of its parent.
getTransformation
open fun getTransformation(): Matrix!
Returns the transformation that has been applied to this view, such as a translation or scaling. The returned Matrix object is owned by ViewNode; do not modify it. Returns null if there is no transformation applied to the view.
It's only relevant when the AssistStructure
is used for assist purposes, not for autofill purposes.
getVisibility
open fun getVisibility(): Int
Returns the visibility mode of this view, as per View.getVisibility()
.
getWebDomain
open fun getWebDomain(): String?
Returns the domain of the HTML document represented by this view.
Typically used when the view associated with the view is a container for an HTML document.
Warning: an autofill service cannot trust the value reported by this method without verifing its authenticity—see the "Web security" section of android.service.autofill.AutofillService
for more details.
Return | |
---|---|
String? |
domain-only part of the document. For example, if the full URL is https://example.com/login?user=my_user , it returns example.com . This value may be null . |
getWebScheme
open fun getWebScheme(): String?
Returns the scheme of the HTML document represented by this view.
Typically used when the view associated with the view is a container for an HTML document.
Return | |
---|---|
String? |
scheme-only part of the document. For example, if the full URL is https://example.com/login?user=my_user , it returns https . This value may be null . |
isAccessibilityFocused
open fun isAccessibilityFocused(): Boolean
Returns true if this node currently had accessibility focus at the time that the structure was collected.
isActivated
open fun isActivated(): Boolean
Returns true if this node has currently been activated by the user.
isAssistBlocked
open fun isAssistBlocked(): Boolean
Returns true if assist data has been blocked starting at this node in the hierarchy.
isCheckable
open fun isCheckable(): Boolean
Returns true if this node represents something that is checkable by the user.
isChecked
open fun isChecked(): Boolean
Returns true if this node is currently in a checked state.
isClickable
open fun isClickable(): Boolean
Returns true if this node is clickable by the user.
isContextClickable
open fun isContextClickable(): Boolean
Returns true if this node is something the user can perform a context click on.
isEnabled
open fun isEnabled(): Boolean
Returns true if this node is in an enabled state.
isFocusable
open fun isFocusable(): Boolean
Returns true if this node can take input focus.
isFocused
open fun isFocused(): Boolean
Returns true if this node currently had input focus at the time that the structure was collected.
isLongClickable
open fun isLongClickable(): Boolean
Returns true if this node is something the user can perform a long click/press on.
isSelected
open fun isSelected(): Boolean
Returns true if this node has currently been selected by the user.