@Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setTranslationY(view, 0); ViewCompat.setAlpha(view, 1); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start();
@Override public void onAnimationStart(View view) { dispatchAddStarting(holder); }
@Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setAlpha(view, 1); ViewCompat.setTranslationY(view, -mOriginalY); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start();
protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; retrieveItemHeight(holder); final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mRemoveAnimations.add(holder); animation.setDuration(getRemoveDuration()) .alpha(0) .translationY(-mOriginalY) .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.setTranslationY(view, -mOriginalY); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
@Override public void onAnimationStart(View view) { dispatchRemoveStarting(holder); }
@Override protected void prepareAnimateAdd(RecyclerView.ViewHolder holder) { retrieveItemHeight(holder); ViewCompat.setTranslationY(holder.itemView, -mOriginalY); }
protected void animateAddImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mAddAnimations.add(holder); animation.translationY(0) .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); ViewCompat.setTranslationY(view, 0); } @Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setTranslationY(view, 0); ViewCompat.setAlpha(view, 1); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
@Override public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) { switch (position){ case 0: mRecyclerView.setItemAnimator(new SlideInOutLeftItemAnimator(mRecyclerView)); break; case 1: mRecyclerView.setItemAnimator(new SlideInOutRightItemAnimator(mRecyclerView)); break; case 2: mRecyclerView.setItemAnimator(new SlideInOutTopItemAnimator(mRecyclerView)); break; case 3: mRecyclerView.setItemAnimator(new SlideInOutBottomItemAnimator(mRecyclerView)); break; case 4: mRecyclerView.setItemAnimator(new ScaleInOutItemAnimator(mRecyclerView)); break; case 5: mRecyclerView.setItemAnimator(new SlideScaleInOutRightItemAnimator(mRecyclerView)); break; } }
protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; retrieveItemHeight(holder); final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mRemoveAnimations.add(holder); animation.setDuration(getRemoveDuration()) .alpha(0) .translationY(-mOriginalY) .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.setTranslationY(view, -mOriginalY); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
@Override public void onAnimationStart(View view) { dispatchRemoveStarting(holder); }
@Override protected void prepareAnimateAdd(RecyclerView.ViewHolder holder) { retrieveItemHeight(holder); ViewCompat.setTranslationY(holder.itemView, -mOriginalY); }
protected void animateAddImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mAddAnimations.add(holder); animation.translationY(0) .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); ViewCompat.setTranslationY(view, 0); } @Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setTranslationY(view, 0); ViewCompat.setAlpha(view, 1); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
@Override public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) { switch (position) { case 0: mRecyclerView.setItemAnimator(new SlideInOutLeftItemAnimator(mRecyclerView)); break; case 1: mRecyclerView.setItemAnimator(new SlideInOutRightItemAnimator(mRecyclerView)); break; case 2: mRecyclerView.setItemAnimator(new SlideInOutTopItemAnimator(mRecyclerView)); break; case 3: mRecyclerView.setItemAnimator(new SlideInOutBottomItemAnimator(mRecyclerView)); break; case 4: mRecyclerView.setItemAnimator(new ScaleInOutItemAnimator(mRecyclerView)); break; case 5: mRecyclerView.setItemAnimator(new SlideScaleInOutRightItemAnimator(mRecyclerView)); break; } }
@Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setAlpha(view, 1); ViewCompat.setTranslationY(view, -mOriginalY); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start();
@Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setTranslationY(view, 0); ViewCompat.setAlpha(view, 1); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start();
@Override public void onAnimationStart(View view) { dispatchAddStarting(holder); }