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

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

Introduction

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

Prototype

public void start() 

Source Link

Usage

From source file:Main.java

public static void animteViewsOut(ViewPropertyAnimatorListener listener, View... views) {
    for (int i = 0; i < views.length; i++) {
        ViewPropertyAnimatorCompat animator = ViewCompat.animate(views[i]).alpha(0f).setDuration(800)
                .setStartDelay(i * 100).setInterpolator(new AccelerateInterpolator());

        if ((i + 1) == views.length) {
            animator.setListener(listener).start();
        } else {/*from  www  . j a  va  2 s .c om*/
            animator.start();
        }
    }
}

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

private void animateAdd(View view, @Nullable RecyclerView.ViewHolder holder) {
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).translationY(0).alpha(1)
            .setDuration(getAddDuration()).setInterpolator(mInterpolator);

    if (holder != null) {
        viewAnimator.setListener(new DefaultAddVpaListener(holder));
    }//from w w w.jav  a2  s  .c o  m

    viewAnimator.start();
}

From source file:android.support.v7.widget.AbsActionBarView.java

public void animateToVisibility(int visibility) {
    ViewPropertyAnimatorCompat anim = setupAnimatorToVisibility(visibility, FADE_DURATION);
    anim.start();
}

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

private void animateRemove(View view, @Nullable RecyclerView.ViewHolder holder) {
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).translationY(view.getHeight()).alpha(0)
            .setDuration(getRemoveDuration()).setInterpolator(mInterpolator);

    if (holder != null) {
        viewAnimator.setListener(new DefaultRemoveVpaListener(holder));
    }/*w ww . j  a  va  2  s  .c om*/

    viewAnimator.start();
}

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

private void animateRemove(View view, @Nullable RecyclerView.ViewHolder holder) {
    ViewPropertyAnimatorCompat viewAnimator = ViewCompat.animate(view).translationY(-view.getHeight()).alpha(0)
            .setDuration(getRemoveDuration()).setInterpolator(mInterpolator);

    if (holder != null) {
        viewAnimator.setListener(new DefaultRemoveVpaListener(holder));
    }//from w  w  w.j  a  v  a  2s  .  co  m

    viewAnimator.start();
}

From source file:com.example.carlitos.swipeitemrecycler.view.animation.swipe_item.animator.impl.BaseItemAnimationManager.java

protected void startActiveItemAnimation(T info, RecyclerView.ViewHolder holder,
        ViewPropertyAnimatorCompat animator) {
    animator.setListener(new BaseAnimatorListener(this, info, holder, animator));
    addActiveAnimationTarget(holder);/*from w w  w  . jav  a  2s. co m*/
    animator.start();
}

From source file:android.support.v7.internal.view.ViewPropertyAnimatorCompatSet.java

public void start() {
    if (mIsStarted)
        return;//  w  w  w  .  j a v  a 2 s .  c  o  m
    for (ViewPropertyAnimatorCompat animator : mAnimators) {
        if (mDuration >= 0) {
            animator.setDuration(mDuration);
        }
        if (mInterpolator != null) {
            animator.setInterpolator(mInterpolator);
        }
        if (mListener != null) {
            animator.setListener(mProxyListener);
        }
        animator.start();
    }

    mIsStarted = true;
}

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

private void animateAdd(View view, @Nullable RecyclerView.ViewHolder holder, Runnable startAction,
        Runnable endAction) {/*  w  ww  . j  ava  2 s .  com*/
    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 w w .  j  a va 2 s .  co m*/
    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();
}