Android APIs
public static class

AssistStructure.ViewNode

extends Object
java.lang.Object
   ↳ android.app.assist.AssistStructure.ViewNode

Class Overview

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 ViewStructure.setAlpha(float).
AssistStructure.ViewNode getChildAt(int index)
Return a child of this node, given an index value from 0 to getChildCount()-1.
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 ViewStructure.setElevation(float).
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.
int getId()
Returns the ID associated with this view, as per View.getId().
String getIdEntry()
If getId() is a resource identifier, this is the entry name of that identifier.
String getIdPackage()
If getId() is a resource identifier, this is the package name of that identifier.
String getIdType()
If getId() is a resource identifier, this is the type name of that identifier.
int getLeft()
Returns the left edge of this view, in pixels, relative to the left edge of its parent.
int getScrollX()
Returns the current X scroll offset of this view, as per View.getScrollX().
int getScrollY()
Returns the current Y scroll offset of this view, as per View.getScrollY().
CharSequence getText()
Returns any text associated with the node that is displayed to the user, or null if there is none.
int getTextBackgroundColor()
If getText() is non-null, this is the main text background color associated with it.
int getTextColor()
If getText() is non-null, this is the main text color associated with it.
int[] getTextLineBaselines()
Return per-line baselines into the text returned by getText().
int[] getTextLineCharOffsets()
Return per-line offsets into the text returned by getText().
int getTextSelectionEnd()
If getText() is non-null, this is where the current selection starts.
int getTextSelectionStart()
If getText() is non-null, this is where the current selection starts.
float getTextSize()
If getText() is non-null, this is the main text size (in pixels) associated with it.
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.
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 View.getVisibility().
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 isSelected()
Returns true if this node has currently been selected by the user.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int TEXT_COLOR_UNDEFINED

Added in API level 23

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)

public static final int TEXT_STYLE_BOLD

Added in API level 23

Constant Value: 1 (0x00000001)

public static final int TEXT_STYLE_ITALIC

Added in API level 23

Constant Value: 2 (0x00000002)

public static final int TEXT_STYLE_STRIKE_THRU

Added in API level 23

Constant Value: 8 (0x00000008)

public static final int TEXT_STYLE_UNDERLINE

Added in API level 23

Constant Value: 4 (0x00000004)

Public Methods

public float getAlpha ()

Added in API level 23

Returns the alpha transformation of the view, used to reduce the overall opacity of the view's contents, as set by ViewStructure.setAlpha(float).

public AssistStructure.ViewNode getChildAt (int index)

Added in API level 23

Return a child of this node, given an index value from 0 to getChildCount()-1.

public int getChildCount ()

Added in API level 23

Return the number of children this node has.

public String getClassName ()

Added in API level 23

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.

public CharSequence getContentDescription ()

Added in API level 23

Returns any content description associated with the node, which semantically describes its purpose for accessibility and other uses.

public float getElevation ()

Added in API level 23

Returns the visual elevation of the view, used for shadowing and other visual characterstics, as set by ViewStructure.setElevation(float).

public Bundle getExtras ()

Added in API level 23

Return a Bundle containing optional vendor-specific extension information.

public int getHeight ()

Added in API level 23

Returns the height of this view, in pixels.

public String getHint ()

Added in API level 23

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.

public int getId ()

Added in API level 23

Returns the ID associated with this view, as per View.getId().

public String getIdEntry ()

Added in API level 23

If getId() is a resource identifier, this is the entry name of that identifier. See ViewStructure.setId for more information.

public String getIdPackage ()

Added in API level 23

If getId() is a resource identifier, this is the package name of that identifier. See ViewStructure.setId for more information.

public String getIdType ()

Added in API level 23

If getId() is a resource identifier, this is the type name of that identifier. See ViewStructure.setId for more information.

public int getLeft ()

Added in API level 23

Returns the left edge of this view, in pixels, relative to the left edge of its parent.

public int getScrollX ()

Added in API level 23

Returns the current X scroll offset of this view, as per View.getScrollX().

public int getScrollY ()

Added in API level 23

Returns the current Y scroll offset of this view, as per View.getScrollY().

public CharSequence getText ()

Added in API level 23

Returns any text associated with the node that is displayed to the user, or null if there is none.

public int getTextBackgroundColor ()

Added in API level 23

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.

public int getTextColor ()

Added in API level 23

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.

public int[] getTextLineBaselines ()

Added in API level 23

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.

public int[] getTextLineCharOffsets ()

Added in API level 23

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.

public int getTextSelectionEnd ()

Added in API level 23

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.

public int getTextSelectionStart ()

Added in API level 23

If getText() is non-null, this is where the current selection starts.

public float getTextSize ()

Added in API level 23

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.

public int getTextStyle ()

Added in API level 23

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.

public int getTop ()

Added in API level 23

Returns the top edge of this view, in pixels, relative to the top edge of its parent.

public Matrix getTransformation ()

Added in API level 23

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.

public int getVisibility ()

Added in API level 23

Returns the visibility mode of this view, as per View.getVisibility().

public int getWidth ()

Added in API level 23

Returns the width of this view, in pixels.

public boolean isAccessibilityFocused ()

Added in API level 23

Returns true if this node currently had accessibility focus at the time that the structure was collected.

public boolean isActivated ()

Added in API level 23

Returns true if this node has currently been activated by the user.

public boolean isAssistBlocked ()

Added in API level 23

Returns true if assist data has been blocked starting at this node in the hierarchy.

public boolean isCheckable ()

Added in API level 23

Returns true if this node represents something that is checkable by the user.

public boolean isChecked ()

Added in API level 23

Returns true if this node is currently in a checked state.

public boolean isClickable ()

Added in API level 23

Returns true if this node is clickable by the user.

public boolean isContextClickable ()

Added in API level 23

Returns true if this node is something the user can perform a context click on.

public boolean isEnabled ()

Added in API level 23

Returns true if this node is in an enabled state.

public boolean isFocusable ()

Added in API level 23

Returns true if this node can take input focus.

public boolean isFocused ()

Added in API level 23

Returns true if this node currently had input focus at the time that the structure was collected.

public boolean isLongClickable ()

Added in API level 23

Returns true if this node is something the user can perform a long click/press on.

public boolean isSelected ()

Added in API level 23

Returns true if this node has currently been selected by the user.