private void animateViewIfNecessary(final int position, @NonNull final View view, @NonNull final ViewGroup parent) {
    """
	Animates given View if necessary.
	
	@param position the position of the item the View represents.
	@param view     the View that should be animated.
	@param parent   the parent the View is hosted in.
    """
        assert mViewAnimator != null;

        /* GridView measures the first View which is returned by getView(int, View, ViewGroup), but does not use that View.
           On KitKat, it does this actually multiple times.
           Therefore, we animate all these first Views, and reset the last animated position when we suspect GridView is measuring. */
        mGridViewPossiblyMeasuring = mGridViewPossiblyMeasuring && (mGridViewMeasuringPosition == -1 || mGridViewMeasuringPosition == position);

        if (mGridViewPossiblyMeasuring) {
            mGridViewMeasuringPosition = position;
            mViewAnimator.setLastAnimatedPosition(-1);
        }

        Animator[] childAnimators;
        if (getDecoratedBaseAdapter() instanceof AnimationAdapter) {
            childAnimators = ((AnimationAdapter) getDecoratedBaseAdapter()).getAnimators(parent, view);
        } else {
            childAnimators = new Animator[0];
        }
        Animator[] animators = getAnimators(parent, view);
        Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

        Animator[] concatAnimators = AnimatorUtil.concatAnimators(childAnimators, animators, alphaAnimator);
        mViewAnimator.animateViewIfNecessary(position, view, concatAnimators);
    }
private void animateViewIfNecessary(final int position, @NonNull final View view, @NonNull final ViewGroup parent) {
        assert mViewAnimator != null;

        /* GridView measures the first View which is returned by getView(int, View, ViewGroup), but does not use that View.
           On KitKat, it does this actually multiple times.
           Therefore, we animate all these first Views, and reset the last animated position when we suspect GridView is measuring. */
        mGridViewPossiblyMeasuring = mGridViewPossiblyMeasuring && (mGridViewMeasuringPosition == -1 || mGridViewMeasuringPosition == position);

        if (mGridViewPossiblyMeasuring) {
            mGridViewMeasuringPosition = position;
            mViewAnimator.setLastAnimatedPosition(-1);
        }

        Animator[] childAnimators;
        if (getDecoratedBaseAdapter() instanceof AnimationAdapter) {
            childAnimators = ((AnimationAdapter) getDecoratedBaseAdapter()).getAnimators(parent, view);
        } else {
            childAnimators = new Animator[0];
        }
        Animator[] animators = getAnimators(parent, view);
        Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

        Animator[] concatAnimators = AnimatorUtil.concatAnimators(childAnimators, animators, alphaAnimator);
        mViewAnimator.animateViewIfNecessary(position, view, concatAnimators);
    }
private void animateViewIfNecessary ( final int position , @ NonNull final View view , @ NonNull final ViewGroup parent ) { assert mViewAnimator != null ; /* GridView measures the first View which is returned by getView(int, View, ViewGroup), but does not use that View.
           On KitKat, it does this actually multiple times.
           Therefore, we animate all these first Views, and reset the last animated position when we suspect GridView is measuring. */ mGridViewPossiblyMeasuring = mGridViewPossiblyMeasuring && ( mGridViewMeasuringPosition == - 1 || mGridViewMeasuringPosition == position ) ; if ( mGridViewPossiblyMeasuring ) { mGridViewMeasuringPosition = position ; mViewAnimator . setLastAnimatedPosition ( - 1 ) ; } Animator [ ] childAnimators ; if ( getDecoratedBaseAdapter ( ) instanceof AnimationAdapter ) { childAnimators = ( ( AnimationAdapter ) getDecoratedBaseAdapter ( ) ) . getAnimators ( parent , view ) ; } else { childAnimators = new Animator [ 0 ] ; } Animator [ ] animators = getAnimators ( parent , view ) ; Animator alphaAnimator = ObjectAnimator . ofFloat ( view , ALPHA , 0 , 1 ) ; Animator [ ] concatAnimators = AnimatorUtil . concatAnimators ( childAnimators , animators , alphaAnimator ) ; mViewAnimator . animateViewIfNecessary ( position , view , concatAnimators ) ; }
Animates given View if necessary.

@param position the position of the item the View represents.
@param view     the View that should be animated.
@param parent   the parent the View is hosted in.
Animates given View if necessary .