AssistStructure.ViewNode
public
static
class
AssistStructure.ViewNode
extends Object
| java.lang.Object | |
| ↳ | android.app.assist.AssistStructure.ViewNode |
Describes a single view in the assist data.
Summary
Constants | |
|---|---|
int |
TEXT_COLOR_UNDEFINED
Magic value for text color that has not been defined, which is very unlikely to be confused with a real text color. |
int |
TEXT_STYLE_BOLD
|
int |
TEXT_STYLE_ITALIC
|
int |
TEXT_STYLE_STRIKE_THRU
|
int |
TEXT_STYLE_UNDERLINE
|
Public methods | |
|---|---|
float
|
getAlpha()
Returns the alpha transformation of the view, used to reduce the overall opacity
of the view's contents, as set by |
String[]
|
getAutofillHints()
Describes the content of a view so that a autofill service can fill in the appropriate data. |
AutofillId
|
getAutofillId()
Gets the id that can be used to autofill the view contents. |
CharSequence[]
|
getAutofillOptions()
Gets the options that can be used to autofill this view. |
int
|
getAutofillType()
Gets the the type of value that can be used to autofill the view contents. |
AutofillValue
|
getAutofillValue()
Gets the the value of this view. |
AssistStructure.ViewNode
|
getChildAt(int index)
Return a child of this node, given an index value from 0 to
|
int
|
getChildCount()
Return the number of children this node has. |
String
|
getClassName()
Returns the class name of the node's implementation, indicating its behavior. |
CharSequence
|
getContentDescription()
Returns any content description associated with the node, which semantically describes its purpose for accessibility and other uses. |
float
|
getElevation()
Returns the visual elevation of the view, used for shadowing and other visual
characterstics, as set by |
Bundle
|
getExtras()
Return a Bundle containing optional vendor-specific extension information. |
int
|
getHeight()
Returns the height of this view, in pixels. |
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. |
ViewStructure.HtmlInfo
|
getHtmlInfo()
Returns the HTML properties associated with this view. |
int
|
getId()
Returns the ID associated with this view, as per |
String
|
getIdEntry()
If |
String
|
getIdPackage()
If |
String
|
getIdType()
If |
int
|
getInputType()
Gets the |
int
|
getLeft()
Returns the left edge of this view, in pixels, relative to the left edge of its parent. |
LocaleList
|
getLocaleList()
Returns the the list of locales associated with this view. |
int
|
getScrollX()
Returns the current X scroll offset of this view, as per
|
int
|
getScrollY()
Returns the current Y scroll offset of this view, as per
|
CharSequence
|
getText()
Returns any text associated with the node that is displayed to the user, or null if there is none. |
int
|
getTextBackgroundColor()
If |
int
|
getTextColor()
If |
int[]
|
getTextLineBaselines()
Return per-line baselines into the text returned by |
int[]
|
getTextLineCharOffsets()
Return per-line offsets into the text returned by |
int
|
getTextSelectionEnd()
If |
int
|
getTextSelectionStart()
If |
float
|
getTextSize()
If |
int
|
getTextStyle()
If |
int
|
getTop()
Returns the top edge of this view, in pixels, relative to the top edge of its parent. |
Matrix
|
getTransformation()
Returns the transformation that has been applied to this view, such as a translation or scaling. |
int
|
getVisibility()
Returns the visibility mode of this view, as per
|
String
|
getWebDomain()
Returns the domain of the HTML document represented by this view. |
int
|
getWidth()
Returns the width of this view, in pixels. |
boolean
|
isAccessibilityFocused()
Returns true if this node currently had accessibility focus at the time that the structure was collected. |
boolean
|
isActivated()
Returns true if this node has currently been activated by the user. |
boolean
|
isAssistBlocked()
Returns true if assist data has been blocked starting at this node in the hierarchy. |
boolean
|
isCheckable()
Returns true if this node represents something that is checkable by the user. |
boolean
|
isChecked()
Returns true if this node is currently in a checked state. |
boolean
|
isClickable()
Returns true if this node is clickable by the user. |
boolean
|
isContextClickable()
Returns true if this node is something the user can perform a context click on. |
boolean
|
isEnabled()
Returns true if this node is in an enabled state. |
boolean
|
isFocusable()
Returns true if this node can take input focus. |
boolean
|
isFocused()
Returns true if this node currently had input focus at the time that the structure was collected. |
boolean
|
isLongClickable()
Returns true if this node is something the user can perform a long click/press on. |
boolean
|
isOpaque()
Returns true if this node is opaque. |
boolean
|
isSelected()
Returns true if this node has currently been selected by the user. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Constants
TEXT_COLOR_UNDEFINED
int TEXT_COLOR_UNDEFINED
Magic value for text color that has not been defined, which is very unlikely to be confused with a real text color.
Constant Value: 1 (0x00000001)
TEXT_STYLE_STRIKE_THRU
int TEXT_STYLE_STRIKE_THRU
Constant Value: 8 (0x00000008)
Public methods
getAlpha
float getAlpha ()
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.
| Returns | |
|---|---|
float |
|
getAutofillHints
String[] getAutofillHints ()
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 getAutofillHints() for more info.
| Returns | |
|---|---|
String[] |
The autofill hints for this view, or null if the structure was created
for Assist purposes.
This value may be |
getAutofillId
AutofillId getAutofillId ()
Gets the id that can be used to autofill the view contents.
It's relevant set when the AssistStructure is used for Autofill purposes.
| Returns | |
|---|---|
AutofillId |
id that can be used to autofill the view contents, or null if the
structure was created for Assist purposes.
This value may be |
getAutofillOptions
CharSequence[] getAutofillOptions ()
Gets the options that can be used to autofill this view.
Typically used by nodes whose 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.
| Returns | |
|---|---|
CharSequence[] |
the options that can be used to autofill this view, or null if the
structure was created for Assist purposes.
This value may be |
getAutofillType
int getAutofillType ()
Gets the 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.
| Returns | |
|---|---|
int |
autofill type as defined by getAutofillType(),
or AUTOFILL_TYPE_NONE if the structure was created for Assist purposes.
|
getAutofillValue
AutofillValue getAutofillValue ()
Gets the the value of this view.
It's only relevant when the AssistStructure is used for Autofill purposes,
not for Assist purposes.
| Returns | |
|---|---|
AutofillValue |
the autofill value of this view, or null if the structure was created
for Assist purposes.
This value may be |
getChildAt
AssistStructure.ViewNode getChildAt (int index)
Return a child of this node, given an index value from 0 to
getChildCount()-1.
| Parameters | |
|---|---|
index |
int |
| Returns | |
|---|---|
AssistStructure.ViewNode |
|
getChildCount
int getChildCount ()
Return the number of children this node has.
| Returns | |
|---|---|
int |
|
getClassName
String getClassName ()
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 Button.
| Returns | |
|---|---|
String |
|
getContentDescription
CharSequence getContentDescription ()
Returns any content description associated with the node, which semantically describes its purpose for accessibility and other uses.
| Returns | |
|---|---|
CharSequence |
|
getElevation
float getElevation ()
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.
| Returns | |
|---|---|
float |
|
getExtras
Bundle getExtras ()
Return a Bundle containing optional vendor-specific extension information.
| Returns | |
|---|---|
Bundle |
|
getHeight
int getHeight ()
Returns the height of this view, in pixels.
| Returns | |
|---|---|
int |
|
getHint
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.
| Returns | |
|---|---|
String |
|
getHtmlInfo
ViewStructure.HtmlInfo getHtmlInfo ()
Returns the HTML properties associated with this view.
It's only relevant when the AssistStructure is used for Autofill purposes,
not for Assist purposes.
| Returns | |
|---|---|
ViewStructure.HtmlInfo |
the HTML properties associated with this view, or null if the
structure was created for Assist purposes.
This value may be |
getId
int getId ()
Returns the ID associated with this view, as per View.getId().
| Returns | |
|---|---|
int |
|
getIdEntry
String getIdEntry ()
If getId() is a resource identifier, this is the entry name of that
identifier. See ViewStructure.setId
for more information.
| Returns | |
|---|---|
String |
|
getIdPackage
String getIdPackage ()
If getId() is a resource identifier, this is the package name of that
identifier. See ViewStructure.setId
for more information.
| Returns | |
|---|---|
String |
|
getIdType
String getIdType ()
If getId() is a resource identifier, this is the type name of that
identifier. See ViewStructure.setId
for more information.
| Returns | |
|---|---|
String |
|
getInputType
int getInputType ()
Gets the InputType bits of this structure.
| Returns | |
|---|---|
int |
bits as defined by InputType.
|
getLeft
int getLeft ()
Returns the left edge of this view, in pixels, relative to the left edge of its parent.
| Returns | |
|---|---|
int |
|
getLocaleList
LocaleList getLocaleList ()
Returns the the list of locales associated with this view.
| Returns | |
|---|---|
LocaleList |
This value may be |
getScrollX
int getScrollX ()
Returns the current X scroll offset of this view, as per
View.getScrollX().
| Returns | |
|---|---|
int |
|
getScrollY
int getScrollY ()
Returns the current Y scroll offset of this view, as per
View.getScrollY().
| Returns | |
|---|---|
int |
|
getText
CharSequence getText ()
Returns any text associated with the node that is displayed to the user, or null if there is none.
| Returns | |
|---|---|
CharSequence |
|
getTextBackgroundColor
int getTextBackgroundColor ()
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.
| Returns | |
|---|---|
int |
|
getTextColor
int getTextColor ()
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.
| Returns | |
|---|---|
int |
|
getTextLineBaselines
int[] getTextLineBaselines ()
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.
| Returns | |
|---|---|
int[] |
|
getTextLineCharOffsets
int[] getTextLineCharOffsets ()
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.
| Returns | |
|---|---|
int[] |
|
getTextSelectionEnd
int getTextSelectionEnd ()
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.
| Returns | |
|---|---|
int |
|
getTextSelectionStart
int getTextSelectionStart ()
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.
| Returns | |
|---|---|
int |
|
getTextSize
float getTextSize ()
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.
| Returns | |
|---|---|
float |
|
getTextStyle
int getTextStyle ()
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.
| Returns | |
|---|---|
int |
|
getTop
int getTop ()
Returns the top edge of this view, in pixels, relative to the top edge of its parent.
| Returns | |
|---|---|
int |
|
getTransformation
Matrix getTransformation ()
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.
| Returns | |
|---|---|
Matrix |
|
getVisibility
int getVisibility ()
Returns the visibility mode of this view, as per
View.getVisibility().
| Returns | |
|---|---|
int |
|
getWebDomain
String getWebDomain ()
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: a AutofillService should only
use this domain for Autofill purposes when it trusts the app generating it (i.e., the app
defined by getActivityComponent()).
| Returns | |
|---|---|
String |
domain-only part of the document. For example, if the full URL is
http://my.site/login?user=my_user, it returns my.site.
This value may be |
getWidth
int getWidth ()
Returns the width of this view, in pixels.
| Returns | |
|---|---|
int |
|
isAccessibilityFocused
boolean isAccessibilityFocused ()
Returns true if this node currently had accessibility focus at the time that the structure was collected.
| Returns | |
|---|---|
boolean |
|
isActivated
boolean isActivated ()
Returns true if this node has currently been activated by the user.
| Returns | |
|---|---|
boolean |
|
isAssistBlocked
boolean isAssistBlocked ()
Returns true if assist data has been blocked starting at this node in the hierarchy.
| Returns | |
|---|---|
boolean |
|
isCheckable
boolean isCheckable ()
Returns true if this node represents something that is checkable by the user.
| Returns | |
|---|---|
boolean |
|
isChecked
boolean isChecked ()
Returns true if this node is currently in a checked state.
| Returns | |
|---|---|
boolean |
|
isClickable
boolean isClickable ()
Returns true if this node is clickable by the user.
| Returns | |
|---|---|
boolean |
|
isContextClickable
boolean isContextClickable ()
Returns true if this node is something the user can perform a context click on.
| Returns | |
|---|---|
boolean |
|
isEnabled
boolean isEnabled ()
Returns true if this node is in an enabled state.
| Returns | |
|---|---|
boolean |
|
isFocusable
boolean isFocusable ()
Returns true if this node can take input focus.
| Returns | |
|---|---|
boolean |
|
isFocused
boolean isFocused ()
Returns true if this node currently had input focus at the time that the structure was collected.
| Returns | |
|---|---|
boolean |
|
isLongClickable
boolean isLongClickable ()
Returns true if this node is something the user can perform a long click/press on.
| Returns | |
|---|---|
boolean |
|
isOpaque
boolean isOpaque ()
Returns true if this node is opaque.
| Returns | |
|---|---|
boolean |
|
isSelected
boolean isSelected ()
Returns true if this node has currently been selected by the user.
| Returns | |
|---|---|
boolean |
|


