@Implements(value=android.view.View.class) public class ShadowView extends Object
View.| Modifier and Type | Field and Description |
|---|---|
static String |
ANDROID_NS |
protected android.util.AttributeSet |
attributeSet |
protected android.view.View |
realView |
android.graphics.Point |
scrollToCoordinates |
| Constructor and Description |
|---|
ShadowView() |
| Modifier and Type | Method and Description |
|---|---|
void |
__constructor__(android.content.Context context,
android.util.AttributeSet attributeSet,
int defStyle) |
protected android.graphics.drawable.Drawable |
buildDrawable(int resourceId)
Build drawable, either LayerDrawable or BitmapDrawable.
|
void |
callOnAttachedToWindow() |
void |
callOnDetachedFromWindow() |
boolean |
checkedPerformClick()
Utility method for clicking on views exposing testing scenarios that are not possible when using the actual app.
|
void |
clearWasInvalidated()
Clears the wasInvalidated flag
|
static boolean |
clickOn(android.view.View view)
Calls
performClick() on a View after ensuring that it and its ancestors are visible and that it
is enabled. |
void |
computeOpaqueFlags() |
boolean |
didRequestLayout() |
void |
draw(android.graphics.Canvas canvas) |
void |
dump()
Dumps the status of this
View to System.out |
void |
dump(PrintStream out,
int indent)
Dumps the status of this
View to System.out at the given indentation level |
static void |
dump(android.view.View view)
Emits an xml-like representation of the view to System.out.
|
protected void |
dumpAttribute(PrintStream out,
String name,
String value) |
protected void |
dumpAttributes(PrintStream out) |
protected void |
dumpFirstPart(PrintStream out,
int indent) |
protected void |
dumpIndent(PrintStream out,
int indent) |
int |
getBackgroundColor()
Deprecated.
Use FEST assertions instead.
|
int |
getBackgroundResourceId()
Deprecated.
Use FEST assertions instead.
|
android.graphics.Bitmap |
getDrawingCache() |
boolean |
getGlobalVisibleRect(android.graphics.Rect rect,
android.graphics.Point globalOffset) |
android.view.MotionEvent |
getLastTouchEvent() |
android.view.View.OnClickListener |
getOnClickListener()
Non-android accessor.
|
android.view.View.OnCreateContextMenuListener |
getOnCreateContextMenuListener()
Non-android accessor.
|
android.view.View.OnLongClickListener |
getOnLongClickListener()
Non-android accessor.
|
android.view.View.OnSystemUiVisibilityChangeListener |
getOnSystemUiVisibilityChangeListener()
Non-android accessor.
|
android.view.View.OnTouchListener |
getOnTouchListener()
Non-android accessor.
|
protected String |
getQualifiers() |
int |
getScrollX() |
int |
getScrollY() |
String |
innerText()
Returns a string representation of this
View. |
static String |
innerText(android.view.View view)
Returns the text contained within this view.
|
void |
invalidate() |
boolean |
isAttachedToWindow() |
int |
lastHapticFeedbackPerformed() |
void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom) |
boolean |
onLayoutWasCalled() |
boolean |
onTouchEvent(android.view.MotionEvent event) |
boolean |
performHapticFeedback(int hapticFeedbackType) |
void |
post(Runnable action) |
void |
postDelayed(Runnable action,
long delayMills) |
void |
postInvalidateDelayed(long delayMilliseconds) |
void |
removeCallbacks(Runnable callback) |
void |
requestLayout() |
void |
scrollTo(int x,
int y) |
void |
setAnimation(android.view.animation.Animation animation) |
void |
setDidRequestLayout(boolean didRequestLayout) |
void |
setGlobalVisibleRect(android.graphics.Rect rect) |
void |
setMyParent(android.view.ViewParent viewParent) |
void |
setOnClickListener(android.view.View.OnClickListener onClickListener) |
void |
setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener onCreateContextMenuListener) |
void |
setOnFocusChangeListener(android.view.View.OnFocusChangeListener l) |
void |
setOnLongClickListener(android.view.View.OnLongClickListener onLongClickListener) |
void |
setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener onSystemUiVisibilityChangeListener) |
void |
setOnTouchListener(android.view.View.OnTouchListener onTouchListener) |
void |
setScrollX(int scrollX) |
void |
setScrollY(int scrollY) |
void |
setViewFocus(boolean hasFocus) |
static String |
visualize(android.view.View view)
Returns a textual representation of the appearance of the object.
|
boolean |
wasInvalidated()
Non-Android accessor.
|
public static final String ANDROID_NS
@RealObject protected android.view.View realView
protected android.util.AttributeSet attributeSet
public android.graphics.Point scrollToCoordinates
public static boolean clickOn(android.view.View view)
performClick() on a View after ensuring that it and its ancestors are visible and that it
is enabled.view - the view to click onView.OnClickListeners were found and fired, false otherwise.RuntimeException - if the preconditions are not met.public static String visualize(android.view.View view)
view - the view to visualizepublic static void dump(android.view.View view)
view - the view to dumppublic static String innerText(android.view.View view)
view - the view to scan for textpublic void __constructor__(android.content.Context context,
android.util.AttributeSet attributeSet,
int defStyle)
protected android.graphics.drawable.Drawable buildDrawable(int resourceId)
resourceId - Resource idprotected String getQualifiers()
public int getBackgroundResourceId()
public int getBackgroundColor()
@HiddenApi @Implementation public void computeOpaqueFlags()
@Implementation public void setOnFocusChangeListener(android.view.View.OnFocusChangeListener l)
@Implementation public void setOnClickListener(android.view.View.OnClickListener onClickListener)
@Implementation public void setOnLongClickListener(android.view.View.OnLongClickListener onLongClickListener)
@Implementation public void setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener onSystemUiVisibilityChangeListener)
@Implementation public void setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener onCreateContextMenuListener)
@Implementation public void draw(android.graphics.Canvas canvas)
@Implementation
public void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
public boolean onLayoutWasCalled()
@Implementation public void requestLayout()
public boolean didRequestLayout()
public void setDidRequestLayout(boolean didRequestLayout)
public void setViewFocus(boolean hasFocus)
@Implementation public void invalidate()
@Implementation public boolean onTouchEvent(android.view.MotionEvent event)
@Implementation public void setOnTouchListener(android.view.View.OnTouchListener onTouchListener)
public android.view.MotionEvent getLastTouchEvent()
public String innerText()
View. Unless overridden, it will be an empty string.
Robolectric extension.
public void dump()
View to System.outpublic void dump(PrintStream out, int indent)
View to System.out at the given indentation levelout - Output stream.indent - Indentation level.protected void dumpFirstPart(PrintStream out, int indent)
protected void dumpAttributes(PrintStream out)
protected void dumpAttribute(PrintStream out, String name, String value)
protected void dumpIndent(PrintStream out, int indent)
public boolean wasInvalidated()
invalidate() has been calledpublic void clearWasInvalidated()
public boolean checkedPerformClick()
RuntimeException - if the view is disabled or if the view or any of its parents are not visible.public android.view.View.OnTouchListener getOnTouchListener()
public android.view.View.OnClickListener getOnClickListener()
public android.view.View.OnLongClickListener getOnLongClickListener()
public android.view.View.OnSystemUiVisibilityChangeListener getOnSystemUiVisibilityChangeListener()
public android.view.View.OnCreateContextMenuListener getOnCreateContextMenuListener()
@Implementation public android.graphics.Bitmap getDrawingCache()
@Implementation public void post(Runnable action)
@Implementation public void postDelayed(Runnable action, long delayMills)
@Implementation public void postInvalidateDelayed(long delayMilliseconds)
@Implementation public void removeCallbacks(Runnable callback)
@Implementation
public void scrollTo(int x,
int y)
@Implementation public int getScrollX()
@Implementation public int getScrollY()
@Implementation public void setScrollX(int scrollX)
@Implementation public void setScrollY(int scrollY)
@Implementation public void setAnimation(android.view.animation.Animation animation)
@Implementation public boolean isAttachedToWindow()
public void callOnAttachedToWindow()
public void callOnDetachedFromWindow()
@Implementation public boolean performHapticFeedback(int hapticFeedbackType)
@Implementation
public boolean getGlobalVisibleRect(android.graphics.Rect rect,
android.graphics.Point globalOffset)
public void setGlobalVisibleRect(android.graphics.Rect rect)
public int lastHapticFeedbackPerformed()
public void setMyParent(android.view.ViewParent viewParent)
Copyright © 2016. All rights reserved.