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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations