From d21cae7b89b7a1f44f59d418a753a962b663f426 Mon Sep 17 00:00:00 2001 From: seven332 Date: Sun, 11 Oct 2015 15:40:27 +0800 Subject: [PATCH] Adjust FloatItemAnimator --- .../hippo/nimingban/itemanimator/FloatItemAnimator.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/hippo/nimingban/itemanimator/FloatItemAnimator.java b/app/src/main/java/com/hippo/nimingban/itemanimator/FloatItemAnimator.java index 78c7b4cb..2953c62e 100644 --- a/app/src/main/java/com/hippo/nimingban/itemanimator/FloatItemAnimator.java +++ b/app/src/main/java/com/hippo/nimingban/itemanimator/FloatItemAnimator.java @@ -23,12 +23,14 @@ import android.support.v7.widget.RecyclerView; import android.view.View; +import com.hippo.util.AnimationUtils; + import java.util.ArrayList; import java.util.List; public class FloatItemAnimator extends RecyclerView.ItemAnimator { - private static final float SPEED = 3f; + private static final float SPEED = 5f; private ArrayList mPendingAdditions = new ArrayList<>(); private ArrayList> mAdditionsList = @@ -88,8 +90,9 @@ private void animateAddImpl(final RecyclerView.ViewHolder holder, float translat view.setVisibility(View.VISIBLE); mAddAnimations.add(holder); view.setTranslationY(translationY); - animation.translationY(0.0f).setDuration((long) (translationY / SPEED)). - setListener(new VpaListenerAdapter() { + animation.translationY(0.0f).setDuration((long) (translationY / SPEED)) + .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR) + .setListener(new VpaListenerAdapter() { @Override public void onAnimationStart(View view) { dispatchAddStarting(holder);