@Implements(value=android.view.accessibility.AccessibilityNodeInfo.class) public class ShadowAccessibilityNodeInfo extends java.lang.Object
Properties of AccessibilityNodeInfo
that are normally locked may be changed using test APIs.
Calls to obtain()
and recycle()
are tracked to help spot bugs.
Modifier and Type | Class and Description |
---|---|
static interface |
ShadowAccessibilityNodeInfo.OnPerformActionListener |
static class |
ShadowAccessibilityNodeInfo.ShadowAccessibilityAction
Shadow of AccessibilityAction.
|
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<android.view.accessibility.AccessibilityNodeInfo> |
CREATOR |
static int |
UNDEFINED_SELECTION_INDEX |
Constructor and Description |
---|
ShadowAccessibilityNodeInfo() |
Modifier and Type | Method and Description |
---|---|
protected void |
__constructor__() |
protected void |
addAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction action) |
protected void |
addAction(int action) |
void |
addChild(android.view.accessibility.AccessibilityNodeInfo child)
Add a child node to this one.
|
protected void |
addChild(android.view.View child) |
protected void |
addChild(android.view.View root,
int virtualDescendantId) |
static boolean |
areThereUnrecycledNodes(boolean printUnrecycledNodesToSystemErr)
Check for leaked objects that were
obtain ed but never recycle d. |
protected boolean |
canOpenPopup() |
protected int |
describeContents() |
boolean |
equals(java.lang.Object object)
Equality check based on reference equality of the Views from which these instances were created, or the equality of their assigned IDs.
|
protected java.util.List<android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction> |
getActionList() |
protected int |
getActions()
Obtain flags for actions supported.
|
protected void |
getBoundsInParent(android.graphics.Rect outBounds) |
protected void |
getBoundsInScreen(android.graphics.Rect outBounds) |
protected android.view.accessibility.AccessibilityNodeInfo |
getChild(int index) |
protected int |
getChildCount() |
protected java.lang.CharSequence |
getClassName() |
protected android.view.accessibility.AccessibilityNodeInfo.CollectionInfo |
getCollectionInfo() |
protected android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo |
getCollectionItemInfo() |
protected java.lang.CharSequence |
getContentDescription() |
protected int |
getDrawingOrder()
Returns the drawing order of the view corresponding to this node.
|
protected java.lang.CharSequence |
getError() |
protected int |
getInputType() |
protected android.view.accessibility.AccessibilityNodeInfo |
getLabeledBy() |
protected android.view.accessibility.AccessibilityNodeInfo |
getLabelFor() |
protected int |
getLiveRegion() |
protected int |
getMaxTextLength() |
protected int |
getMovementGranularities() |
protected java.lang.CharSequence |
getPackageName() |
protected android.view.accessibility.AccessibilityNodeInfo |
getParent() |
java.util.List<java.lang.Integer> |
getPerformedActions() |
java.util.List<android.util.Pair<java.lang.Integer,android.os.Bundle>> |
getPerformedActionsWithArgs() |
protected android.view.accessibility.AccessibilityNodeInfo.RangeInfo |
getRangeInfo() |
protected java.lang.CharSequence |
getText() |
protected int |
getTextSelectionEnd()
Gets the text selection end.
|
protected int |
getTextSelectionStart()
Gets the text selection start.
|
protected android.view.accessibility.AccessibilityNodeInfo |
getTraversalAfter() |
protected android.view.accessibility.AccessibilityNodeInfo |
getTraversalBefore() |
protected java.lang.String |
getViewIdResourceName() |
protected android.view.accessibility.AccessibilityWindowInfo |
getWindow() |
protected int |
getWindowId()
Returns the id of the window from which the info comes.
|
int |
hashCode() |
protected boolean |
isAccessibilityFocused() |
protected boolean |
isCheckable() |
protected boolean |
isChecked() |
protected boolean |
isClickable() |
protected boolean |
isContentInvalid() |
protected boolean |
isDismissable() |
protected boolean |
isEditable() |
protected boolean |
isEnabled() |
protected boolean |
isFocusable() |
protected boolean |
isFocused() |
protected boolean |
isLongClickable() |
protected boolean |
isMultiLine() |
protected boolean |
isPassword() |
boolean |
isPasteable() |
protected boolean |
isScrollable() |
protected boolean |
isSelected() |
boolean |
isTextSelectionSetable() |
protected boolean |
isVisibleToUser() |
protected static android.view.accessibility.AccessibilityNodeInfo |
obtain() |
protected static android.view.accessibility.AccessibilityNodeInfo |
obtain(android.view.accessibility.AccessibilityNodeInfo info) |
protected static android.view.accessibility.AccessibilityNodeInfo |
obtain(android.view.View view) |
protected static android.view.accessibility.AccessibilityNodeInfo |
obtain(android.view.View root,
int virtualDescendantId) |
protected boolean |
performAction(int action) |
protected boolean |
performAction(int action,
android.os.Bundle arguments) |
protected void |
recycle() |
protected boolean |
refresh() |
protected boolean |
removeAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction action) |
protected void |
removeAction(int action) |
static void |
resetObtainedInstances()
Clear list of obtained instance objects.
|
protected void |
setAccessibilityFocused(boolean focused) |
void |
setAccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo info) |
protected void |
setBoundsInParent(android.graphics.Rect b) |
protected void |
setBoundsInScreen(android.graphics.Rect b) |
protected void |
setCanOpenPopup(boolean opensPopup) |
protected void |
setCheckable(boolean checkable) |
protected void |
setChecked(boolean checked) |
protected void |
setClassName(java.lang.CharSequence name) |
protected void |
setClickable(boolean isClickable) |
protected void |
setCollectionInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionInfo collectionInfo) |
protected void |
setCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo collectionItemInfo) |
protected void |
setContentDescription(java.lang.CharSequence description) |
protected void |
setContentInvalid(boolean contentInvalid) |
protected void |
setDismissable(boolean dismissable) |
protected void |
setDrawingOrder(int drawingOrder)
Sets the drawing order of the view corresponding to this node.
|
protected void |
setEditable(boolean isEditable) |
protected void |
setEnabled(boolean enabled) |
protected void |
setError(java.lang.CharSequence error) |
protected void |
setFocusable(boolean isFocusable) |
protected void |
setFocused(boolean isFocused) |
protected void |
setInputType(int inputType) |
void |
setLabeledBy(android.view.accessibility.AccessibilityNodeInfo info) |
void |
setLabelFor(android.view.accessibility.AccessibilityNodeInfo info) |
protected void |
setLiveRegion(int liveRegion) |
protected void |
setLongClickable(boolean isLongClickable) |
protected void |
setMaxTextLength(int maxTextLength) |
protected void |
setMovementGranularities(int movementGranularities) |
protected void |
setMultiLine(boolean multiLine) |
void |
setOnPerformActionListener(ShadowAccessibilityNodeInfo.OnPerformActionListener listener)
Configure the return result of an action if it is performed
|
protected void |
setPackageName(java.lang.CharSequence packageName) |
protected void |
setPassword(boolean password) |
void |
setPasteable(boolean isPasteable) |
protected void |
setRangeInfo(android.view.accessibility.AccessibilityNodeInfo.RangeInfo rangeInfo) |
void |
setRefreshReturnValue(boolean refreshReturnValue) |
protected void |
setScrollable(boolean isScrollable) |
protected void |
setSelected(boolean selected) |
protected void |
setSource(android.view.View source) |
protected void |
setSource(android.view.View root,
int virtualDescendantId) |
protected void |
setText(java.lang.CharSequence t) |
protected void |
setTextSelection(int start,
int end) |
void |
setTextSelectionSetable(boolean isTextSelectionSetable) |
void |
setTraversalAfter(android.view.accessibility.AccessibilityNodeInfo info)
Sets the view whose node is visited after this one in accessibility traversal.
|
protected void |
setTraversalAfter(android.view.View view,
int virtualDescendantId) |
void |
setTraversalBefore(android.view.accessibility.AccessibilityNodeInfo info)
Sets the view before whose node this one should be visited during traversal.
|
protected void |
setTraversalBefore(android.view.View info,
int virtualDescendantId) |
protected void |
setViewIdResourceName(java.lang.String viewIdResourceName) |
protected void |
setVisibleToUser(boolean isVisibleToUser) |
protected void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final int UNDEFINED_SELECTION_INDEX
public static final android.os.Parcelable.Creator<android.view.accessibility.AccessibilityNodeInfo> CREATOR
@Implementation protected void __constructor__()
@Implementation protected static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.accessibility.AccessibilityNodeInfo info)
@Implementation protected static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View view)
@Implementation protected static android.view.accessibility.AccessibilityNodeInfo obtain()
@Implementation protected static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View root, int virtualDescendantId)
public static boolean areThereUnrecycledNodes(boolean printUnrecycledNodesToSystemErr)
Check for leaked objects that were obtain
ed but never recycle
d.
printUnrecycledNodesToSystemErr
- obtain
that lack matching calls to recycle
are dumped to System.err.true
if there are unrecycled nodes@Resetter public static void resetObtainedInstances()
Clear list of obtained instance objects. areThereUnrecycledNodes
will always return false if called immediately afterwards.
@Implementation protected void recycle()
@Implementation protected int getChildCount()
@Implementation protected android.view.accessibility.AccessibilityNodeInfo getChild(int index)
@Implementation protected android.view.accessibility.AccessibilityNodeInfo getParent()
@Implementation(minSdk=18) protected boolean refresh()
public void setRefreshReturnValue(boolean refreshReturnValue)
@Implementation protected boolean isClickable()
@Implementation protected boolean isLongClickable()
@Implementation protected boolean isFocusable()
@Implementation protected boolean isFocused()
@Implementation protected boolean isVisibleToUser()
@Implementation protected boolean isScrollable()
public boolean isPasteable()
@Implementation(minSdk=18) protected boolean isEditable()
public boolean isTextSelectionSetable()
@Implementation protected boolean isCheckable()
@Implementation protected void setCheckable(boolean checkable)
@Implementation protected void setChecked(boolean checked)
@Implementation protected boolean isChecked()
@Implementation protected void setEnabled(boolean enabled)
@Implementation protected boolean isEnabled()
@Implementation protected void setPassword(boolean password)
@Implementation protected boolean isPassword()
@Implementation protected void setSelected(boolean selected)
@Implementation protected boolean isSelected()
@Implementation protected void setAccessibilityFocused(boolean focused)
@Implementation protected boolean isAccessibilityFocused()
@Implementation(minSdk=21) protected void setMultiLine(boolean multiLine)
@Implementation(minSdk=21) protected boolean isMultiLine()
@Implementation(minSdk=21) protected void setContentInvalid(boolean contentInvalid)
@Implementation(minSdk=21) protected boolean isContentInvalid()
@Implementation(minSdk=21) protected void setDismissable(boolean dismissable)
@Implementation(minSdk=21) protected boolean isDismissable()
@Implementation(minSdk=21) protected void setCanOpenPopup(boolean opensPopup)
@Implementation(minSdk=21) protected boolean canOpenPopup()
public void setTextSelectionSetable(boolean isTextSelectionSetable)
@Implementation protected void setClickable(boolean isClickable)
@Implementation protected void setLongClickable(boolean isLongClickable)
@Implementation protected void setFocusable(boolean isFocusable)
@Implementation protected void setFocused(boolean isFocused)
@Implementation protected void setScrollable(boolean isScrollable)
public void setPasteable(boolean isPasteable)
@Implementation(minSdk=18) protected void setEditable(boolean isEditable)
@Implementation protected void setVisibleToUser(boolean isVisibleToUser)
@Implementation protected void setContentDescription(java.lang.CharSequence description)
@Implementation protected java.lang.CharSequence getContentDescription()
@Implementation protected void setClassName(java.lang.CharSequence name)
@Implementation protected java.lang.CharSequence getClassName()
@Implementation protected void setText(java.lang.CharSequence t)
@Implementation protected java.lang.CharSequence getText()
@Implementation(minSdk=18) protected void setTextSelection(int start, int end)
@Implementation(minSdk=18) protected int getTextSelectionStart()
Gets the text selection start.
@Implementation(minSdk=18) protected int getTextSelectionEnd()
Gets the text selection end.
@Implementation(minSdk=18) protected android.view.accessibility.AccessibilityNodeInfo getLabelFor()
public void setLabelFor(android.view.accessibility.AccessibilityNodeInfo info)
@Implementation(minSdk=17) protected android.view.accessibility.AccessibilityNodeInfo getLabeledBy()
public void setLabeledBy(android.view.accessibility.AccessibilityNodeInfo info)
@Implementation protected int getMovementGranularities()
@Implementation protected void setMovementGranularities(int movementGranularities)
@Implementation protected java.lang.CharSequence getPackageName()
@Implementation protected void setPackageName(java.lang.CharSequence packageName)
@Implementation(minSdk=18) protected java.lang.String getViewIdResourceName()
@Implementation(minSdk=18) protected void setViewIdResourceName(java.lang.String viewIdResourceName)
@Implementation(minSdk=19) protected android.view.accessibility.AccessibilityNodeInfo.CollectionInfo getCollectionInfo()
@Implementation(minSdk=19) protected void setCollectionInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionInfo collectionInfo)
@Implementation(minSdk=19) protected android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo getCollectionItemInfo()
@Implementation(minSdk=19) protected void setCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo collectionItemInfo)
@Implementation(minSdk=19) protected int getInputType()
@Implementation(minSdk=19) protected void setInputType(int inputType)
@Implementation(minSdk=19) protected int getLiveRegion()
@Implementation(minSdk=19) protected void setLiveRegion(int liveRegion)
@Implementation(minSdk=19) protected android.view.accessibility.AccessibilityNodeInfo.RangeInfo getRangeInfo()
@Implementation(minSdk=19) protected void setRangeInfo(android.view.accessibility.AccessibilityNodeInfo.RangeInfo rangeInfo)
@Implementation(minSdk=21) protected int getMaxTextLength()
@Implementation(minSdk=21) protected void setMaxTextLength(int maxTextLength)
@Implementation(minSdk=21) protected java.lang.CharSequence getError()
@Implementation(minSdk=21) protected void setError(java.lang.CharSequence error)
@Implementation(minSdk=22) protected android.view.accessibility.AccessibilityNodeInfo getTraversalAfter()
@Implementation(minSdk=22) protected void setTraversalAfter(android.view.View view, int virtualDescendantId)
public void setTraversalAfter(android.view.accessibility.AccessibilityNodeInfo info)
Sets the view whose node is visited after this one in accessibility traversal.
This may be useful for configuring traversal order in tests before the corresponding views have been inflated.
info
- The previous node.getTraversalAfter()
@Implementation(minSdk=22) protected android.view.accessibility.AccessibilityNodeInfo getTraversalBefore()
@Implementation(minSdk=22) protected void setTraversalBefore(android.view.View info, int virtualDescendantId)
public void setTraversalBefore(android.view.accessibility.AccessibilityNodeInfo info)
Sets the view before whose node this one should be visited during traversal.
This may be useful for configuring traversal order in tests before the corresponding views have been inflated.
info
- The view providing the preceding node.getTraversalBefore()
@Implementation protected void setSource(android.view.View source)
@Implementation protected void setSource(android.view.View root, int virtualDescendantId)
@Implementation protected void getBoundsInScreen(android.graphics.Rect outBounds)
@Implementation protected void getBoundsInParent(android.graphics.Rect outBounds)
@Implementation protected void setBoundsInScreen(android.graphics.Rect b)
@Implementation protected void setBoundsInParent(android.graphics.Rect b)
@Implementation protected void addAction(int action)
@Implementation(minSdk=21) protected void addAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction action)
@Implementation(minSdk=21) protected void removeAction(int action)
@Implementation(minSdk=21) protected boolean removeAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction action)
@Implementation protected int getActions()
Obtain flags for actions supported. Currently only supports AccessibilityNodeInfo.ACTION_CLICK
, AccessibilityNodeInfo.ACTION_LONG_CLICK
, AccessibilityNodeInfo.ACTION_SCROLL_FORWARD
, AccessibilityNodeInfo.ACTION_PASTE
, AccessibilityNodeInfo.ACTION_FOCUS
, AccessibilityNodeInfo.ACTION_SET_SELECTION
, AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD
Returned value is derived from the getters.
@Implementation(minSdk=24) protected int getDrawingOrder()
Returns the drawing order of the view corresponding to this node.
@Implementation(minSdk=24) protected void setDrawingOrder(int drawingOrder)
Sets the drawing order of the view corresponding to this node.
@Implementation(minSdk=21) protected android.view.accessibility.AccessibilityWindowInfo getWindow()
@Implementation protected int getWindowId()
Returns the id of the window from which the info comes.
public void setAccessibilityWindowInfo(android.view.accessibility.AccessibilityWindowInfo info)
@Implementation(minSdk=21) protected java.util.List<android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction> getActionList()
@Implementation protected boolean performAction(int action)
@Implementation protected boolean performAction(int action, android.os.Bundle arguments)
@Implementation public boolean equals(java.lang.Object object)
Equality check based on reference equality of the Views from which these instances were created, or the equality of their assigned IDs.
equals
in class java.lang.Object
@Implementation public int hashCode()
hashCode
in class java.lang.Object
public void addChild(android.view.accessibility.AccessibilityNodeInfo child)
Add a child node to this one. Also initializes the parent field of the child.
child
- The node to be added as a child.@Implementation protected void addChild(android.view.View child)
@Implementation protected void addChild(android.view.View root, int virtualDescendantId)
public java.util.List<java.lang.Integer> getPerformedActions()
public java.util.List<android.util.Pair<java.lang.Integer,android.os.Bundle>> getPerformedActionsWithArgs()
@Implementation protected int describeContents()
@Implementation protected void writeToParcel(android.os.Parcel dest, int flags)
public void setOnPerformActionListener(ShadowAccessibilityNodeInfo.OnPerformActionListener listener)
Configure the return result of an action if it is performed
listener
- The listener.