use of org.wikipedia.feed.progress.ProgressCardView in project apps-android-wikipedia by wikimedia.
the class FeedItemAnimator method animateAddImpl.
private void animateAddImpl(final ViewHolder holder) {
final View view = holder.itemView;
if (view instanceof ProgressCardView) {
view.setAlpha(1);
view.setTranslationY(0);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
return;
}
final ViewPropertyAnimator animation = view.animate();
mAddAnimations.add(holder);
animation.alpha(1).translationY(0).setDuration(getAddDuration()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(Animator animator) {
view.setTranslationY(0);
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
Aggregations