@Test public void testOnAnimationFinished() throws NoSuchFieldException, IllegalAccessException { TextView desc = mock(TextView.class); TextView actionDesc = mock(TextView.class); mCoachmarkView.mIvActionArrow = mock(ImageView.class); DescriptionRenderer descRenderer = mock(DescriptionRenderer.class); ActionDescriptionRenderer actDescRenderer = mock(ActionDescriptionRenderer.class); when(actDescRenderer.isRenderingPossible(mCoachmarkView)).thenReturn(true); ButtonRenderer buttonRenderer = mock(ButtonRenderer.class); mCoachmarkView.setActionDescription(actionDesc); mCoachmarkView.setDescription(desc); mCoachmarkView.setButtonRenderer(buttonRenderer); mCoachmarkView.setActionDescriptionRenderer(actDescRenderer); mCoachmarkView.setDescriptionRenderer(descRenderer); mCoachmarkView.onAnimationFinished(); verify(descRenderer, times(1)).render(mCoachmarkView, desc); verify(actDescRenderer, times(1)).render(mCoachmarkView, actionDesc, mCoachmarkView.mIvActionArrow); verify(actDescRenderer, times(1)).isRenderingPossible(mCoachmarkView); verify(buttonRenderer, times(1)).render(mCoachmarkView); }
@Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } }
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } } }
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } } CoachmarkView(Context context);  CoachmarkView(Context context, AttributeSet attrs);  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); }
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } } CoachmarkView(Context context);  CoachmarkView(Context context, AttributeSet attrs);  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener); }
CoachmarkView extends FrameLayout implements CoachmarkViewLayout, AnimationListener { @Override public void onAnimationFinished() { if (mDescription != null) { mDescriptionRenderer.render(this, mDescription); mDescription.setVisibility(VISIBLE); } if (mActionDescription != null && mActionDescriptionRenderer != null) { renderActionDescription(); mActionDescription.setVisibility(VISIBLE); mIvActionArrow.setVisibility(VISIBLE); } if (mButtonRenderer != null) { mButtonRenderer.render(CoachmarkView.this); } } CoachmarkView(Context context);  CoachmarkView(Context context, AttributeSet attrs);  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  CoachmarkView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); @Override void onAnimationFinished(); CoachmarkView show(); @NonNull RectF calcActionArrowRect(); RectF calcActionDescriptionRect(); RectF calcDescriptionRect(); RectF calcScreenRectF(); RectF calcCircleRectF(); @Override boolean isInEditMode(); void setActionDescription(View actionDescription); void setDescription(View description); void setActionDescriptionRenderer(ActionDescriptionRenderer... actionDescriptionRenderer); void setDescriptionRenderer(DescriptionRenderer descriptionRenderer); void setView(View view); void setButtonRenderer(ButtonRenderer buttonRenderer); void setBackColor(int backColor); void setPaddingAroundCircle(int paddingAroundCircle); @Override void dismiss(); void setAnimationRenderer(AnimationRenderer animationRenderer); void setDismissListener(DismissListener listener);  }