Example usage for android.support.v4.view ViewPropertyAnimatorCompat withStartAction

List of usage examples for android.support.v4.view ViewPropertyAnimatorCompat withStartAction

Introduction

In this page you can find the example usage for android.support.v4.view ViewPropertyAnimatorCompat withStartAction.

Prototype

public ViewPropertyAnimatorCompat withStartAction(Runnable runnable) 

Source Link

Usage

From source file:de.base.utility.animators.FadeInAnimator.java

private void animateAdd(View view, @Nullable RecyclerView.ViewHolder holder, Runnable startAction,
        Runnable endAction) {/*from   w  w w .j a v  a 2  s  .  co  m*/
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).alpha(1).setDuration(getAddDuration())
            .setInterpolator(mInterpolator);

    if (holder != null)
        viewAnimator.setListener(new DefaultAddVpaListener(holder));
    if (startAction != null)
        viewAnimator.withStartAction(startAction);
    if (endAction != null)
        viewAnimator.withEndAction(endAction);

    viewAnimator.start();
}

From source file:de.base.utility.animators.FadeInAnimator.java

private void animateRemove(View view, @Nullable RecyclerView.ViewHolder holder, Runnable startAction,
        Runnable endAction) {/*from   w  ww  .  j a  va 2 s  .c om*/
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).alpha(0).setDuration(getRemoveDuration())
            .setInterpolator(mInterpolator);

    if (holder != null)
        viewAnimator.setListener(new DefaultRemoveVpaListener(holder));
    if (startAction != null)
        viewAnimator.withStartAction(startAction);
    if (endAction != null)
        viewAnimator.withEndAction(endAction);

    viewAnimator.start();
}

From source file:de.base.utility.animators.ScaleInAnimator.java

private void animateAdd(View view, float scale, Runnable startAction, Runnable endAction,
        @Nullable RecyclerView.ViewHolder holder) {
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).scaleX(scale).scaleY(scale)
            .setDuration(getAddDuration()).setInterpolator(mInterpolator);

    if (holder != null)
        viewAnimator.setListener(new DefaultAddVpaListener(holder));
    if (startAction != null)
        viewAnimator.withStartAction(startAction);
    if (endAction != null)
        viewAnimator.withEndAction(endAction);

    viewAnimator.start();/*w  w w .ja v  a 2 s .  c  o  m*/
}

From source file:de.base.utility.animators.ScaleInAnimator.java

private void animateRemove(View view, float scale, Runnable startAction, Runnable endAction,
        @Nullable RecyclerView.ViewHolder holder) {
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).scaleX(scale).scaleY(scale)
            .setDuration(getRemoveDuration()).setInterpolator(mInterpolator);

    if (holder != null)
        viewAnimator.setListener(new DefaultRemoveVpaListener(holder));
    if (startAction != null)
        viewAnimator.withStartAction(startAction);
    if (endAction != null)
        viewAnimator.withEndAction(endAction);

    viewAnimator.start();/* w ww . j  ava2 s .c  o m*/
}