Search in sources :

Example 11 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project RecyclerViewItemAnimators by gabrielemariotti.

the class SlideInOutRightItemAnimator method animateRemoveImpl.

protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mRemoveAnimations.add(holder);
    animation.setDuration(getRemoveDuration()).alpha(0).translationX(+mRecyclerView.getLayoutManager().getWidth()).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchRemoveStarting(holder);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            ViewCompat.setAlpha(view, 1);
            ViewCompat.setTranslationX(view, +mRecyclerView.getLayoutManager().getWidth());
            dispatchRemoveFinished(holder);
            mRemoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 12 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project RecyclerViewItemAnimators by gabrielemariotti.

the class SlideInOutRightItemAnimator method animateAddImpl.

protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mAddAnimations.add(holder);
    animation.translationX(0).alpha(1).setDuration(getAddDuration()).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchAddStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            ViewCompat.setTranslationX(view, 0);
            ViewCompat.setAlpha(view, 1);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            dispatchAddFinished(holder);
            ViewCompat.setTranslationX(view, 0);
            ViewCompat.setAlpha(view, 1);
            mAddAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 13 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project RecyclerViewItemAnimators by gabrielemariotti.

the class SlideScaleInOutRightItemAnimator method animateRemoveImpl.

protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mRemoveAnimations.add(holder);
    animation.setDuration(getRemoveDuration()).scaleX(0).scaleY(0).alpha(0).translationX(+mRecyclerView.getLayoutManager().getWidth()).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchRemoveStarting(holder);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            ViewCompat.setAlpha(view, 1);
            ViewCompat.setScaleX(view, 0);
            ViewCompat.setScaleY(view, 0);
            ViewCompat.setTranslationX(view, +mRecyclerView.getLayoutManager().getWidth());
            dispatchRemoveFinished(holder);
            mRemoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 14 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project instructure-android by instructure.

the class ExpandCollapseItemAnimator method animateRemoveImpl.

private void animateRemoveImpl(final ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mRemoveAnimations.add(holder);
    animation.setDuration(getRemoveDuration()).alpha(0).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchRemoveStarting(holder);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            ViewCompat.setAlpha(view, 1);
            dispatchRemoveFinished(holder);
            mRemoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 15 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project instructure-android by instructure.

the class ExpandCollapseItemAnimator method animateAddImpl.

private void animateAddImpl(final ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mAddAnimations.add(holder);
    animation.alpha(1).setDuration(getAddDuration()).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchAddStarting(holder);
        }

        @Override
        public void onAnimationCancel(View view) {
            ViewCompat.setAlpha(view, 1);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            dispatchAddFinished(holder);
            mAddAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

ViewPropertyAnimatorCompat (android.support.v4.view.ViewPropertyAnimatorCompat)46 View (android.view.View)40 RecyclerView (android.support.v7.widget.RecyclerView)33 ViewHolder (android.support.v7.widget.RecyclerView.ViewHolder)6 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)3 BezierDecelerateInterpolator (acr.browser.lightning.interpolator.BezierDecelerateInterpolator)2 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 ViewPropertyAnimatorUpdateListener (android.support.v4.view.ViewPropertyAnimatorUpdateListener)1 AbsListView (android.widget.AbsListView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 AnimatorViewHolder (im.actor.sdk.controllers.fragment.AnimatorViewHolder)1 AnimateViewHolder (jp.wasabeef.recyclerview.animators.holder.AnimateViewHolder)1