Package org.robolectric.shadows
Class ShadowAccessibilityWindowInfo
- java.lang.Object
-
- org.robolectric.shadows.ShadowAccessibilityWindowInfo
-
@Implements(value=android.view.accessibility.AccessibilityWindowInfo.class, minSdk=21) public class ShadowAccessibilityWindowInfo extends Object
Shadow ofAccessibilityWindowInfo
that allows a test to set properties that are locked in the original class.
-
-
Constructor Summary
Constructors Constructor Description ShadowAccessibilityWindowInfo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
__constructor__()
void
addChild(AccessibilityWindowInfo child)
static boolean
areThereUnrecycledWindows(boolean printUnrecycledWindowsToSystemErr)
Check for leaked objects that wereobtain
ed but neverrecycle
d.boolean
deepEquals(Object object)
protected AccessibilityNodeInfo
getAnchor()
protected void
getBoundsInScreen(Rect outBounds)
protected AccessibilityWindowInfo
getChild(int index)
protected int
getChildCount()
protected int
getId()
protected int
getLayer()
protected AccessibilityWindowInfo
getParent()
protected AccessibilityNodeInfo
getRoot()
protected CharSequence
getTitle()
Returns the title of this window, ornull
if none is available.protected int
getType()
int
hashCode()
protected boolean
isAccessibilityFocused()
protected boolean
isActive()
protected boolean
isFocused()
protected static AccessibilityWindowInfo
obtain()
protected static AccessibilityWindowInfo
obtain(AccessibilityWindowInfo window)
protected void
recycle()
static void
resetObtainedInstances()
Clear list of obtained instance objects.void
setAccessibilityFocused(boolean value)
void
setActive(boolean value)
void
setAnchor(AccessibilityNodeInfo anchor)
void
setBoundsInScreen(Rect bounds)
void
setFocused(boolean focused)
void
setId(int value)
void
setLayer(int value)
void
setRoot(AccessibilityNodeInfo root)
void
setTitle(CharSequence value)
Sets the title of this window.void
setType(int value)
String
toString()
-
-
-
Method Detail
-
__constructor__
@Implementation protected void __constructor__()
-
obtain
@Implementation protected static AccessibilityWindowInfo obtain()
-
obtain
@Implementation protected static AccessibilityWindowInfo obtain(AccessibilityWindowInfo window)
-
resetObtainedInstances
public static void resetObtainedInstances()
Clear list of obtained instance objects.areThereUnrecycledWindows
will always return false if called immediately afterwards.
-
areThereUnrecycledWindows
public static boolean areThereUnrecycledWindows(boolean printUnrecycledWindowsToSystemErr)
Check for leaked objects that wereobtain
ed but neverrecycle
d.- Parameters:
printUnrecycledWindowsToSystemErr
- - if true, stack traces of calls toobtain
that lack matching calls torecycle
are dumped to System.err.- Returns:
true
if there are unrecycled windows
-
deepEquals
public boolean deepEquals(Object object)
-
hashCode
@Implementation public int hashCode()
-
getType
@Implementation protected int getType()
-
getChildCount
@Implementation protected int getChildCount()
-
getChild
@Implementation protected AccessibilityWindowInfo getChild(int index)
-
getParent
@Implementation protected AccessibilityWindowInfo getParent()
-
getRoot
@Implementation protected AccessibilityNodeInfo getRoot()
-
getAnchor
@Implementation(minSdk=24) protected AccessibilityNodeInfo getAnchor()
-
isActive
@Implementation protected boolean isActive()
-
getId
@Implementation protected int getId()
-
getBoundsInScreen
@Implementation protected void getBoundsInScreen(Rect outBounds)
-
getLayer
@Implementation protected int getLayer()
-
getTitle
@Implementation(minSdk=24) protected CharSequence getTitle()
Returns the title of this window, ornull
if none is available.
-
isFocused
@Implementation protected boolean isFocused()
-
isAccessibilityFocused
@Implementation protected boolean isAccessibilityFocused()
-
recycle
@Implementation protected void recycle()
-
setRoot
public void setRoot(AccessibilityNodeInfo root)
-
setAnchor
public void setAnchor(AccessibilityNodeInfo anchor)
-
setType
@Implementation public void setType(int value)
-
setBoundsInScreen
@Implementation(maxSdk=29) public void setBoundsInScreen(Rect bounds)
-
setAccessibilityFocused
@Implementation public void setAccessibilityFocused(boolean value)
-
setActive
@Implementation public void setActive(boolean value)
-
setId
@Implementation public void setId(int value)
-
setLayer
@Implementation public void setLayer(int value)
-
setTitle
@Implementation(minSdk=24) public void setTitle(CharSequence value)
Sets the title of this window.- Parameters:
value
- TheCharSequence
to set as the title of this window
-
setFocused
@Implementation public void setFocused(boolean focused)
-
addChild
public void addChild(AccessibilityWindowInfo child)
-
toString
@Implementation public String toString()
-
-