private ViewPropertyAnimator createAnimator ( @ NonNull final View animatedView , @ NonNull final FadeAnimation animation , @ Nullable final AnimatorListener listener , final boolean show ) { if ( animation . getAlpha ( ) != null ) { ViewPropertyAnimator animator = animatedView . animate ( ) . setInterpolator ( animation . getInterpolator ( ) ) . setDuration ( getDuration ( animatedView , animation ) ) . setStartDelay ( animation . getStartDelay ( ) ) . setListener ( listener ) ; if ( show ) { animatedView . setAlpha ( animation . getAlpha ( ) ) ; animator . alpha ( 1 ) ; } else { animatedView . setAlpha ( 1f ) ; animator . alpha ( animation . getAlpha ( ) ) ; } return animator ; } return null ; }
Creates an animator which should be used for a fade animation .