TextViewTarget extends ViewTarget<TextView> { @Override public ViewTarget<TextView> fade() { int loc = TextViewDrawableCrossFadeAnimation.LEFT; switch (location) { case LEFT: loc = TextViewDrawableCrossFadeAnimation.LEFT; break; case TOP: loc = TextViewDrawableCrossFadeAnimation.TOP; break; case RIGHT: loc = TextViewDrawableCrossFadeAnimation.RIGHT; break; case BOTTOM: loc = TextViewDrawableCrossFadeAnimation.BOTTOM; break; } TextViewDrawableCrossFadeAnimation ani = new TextViewDrawableCrossFadeAnimation(); ani.setLocation(loc); if (boundsLeft > -1) { ani.setBounds(boundsLeft, boundsTop, boundsRight, boundsBottom); } return animation(ani); } TextViewTarget(TextView textView);  TextViewTarget(MirageRequest request, TextView textView); TextViewTarget location(@Location int location); TextViewTarget bounds(int left, int top, int right, int bottom); @Override ViewTarget<TextView> fade(); static final int LEFT; static final int TOP; static final int RIGHT; static final int BOTTOM; }
@Test public void testFadeCreatesAnimation() { TextView textView = new TextView(RuntimeEnvironment.application); TextViewTarget target = new TextViewTarget(textView); target.placeHolder(new ColorDrawable(Color.RED)); target.error(new ColorDrawable(Color.BLUE)); Assert.assertNull(target.animation()); target.fade(); Assert.assertNotNull(target.animation()); }