Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
Adjust FloatItemAnimator
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Oct 11, 2015
1 parent 7c8df26 commit d21cae7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<RecyclerView.ViewHolder> mPendingAdditions = new ArrayList<>();
private ArrayList<ArrayList<RecyclerView.ViewHolder>> mAdditionsList =
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d21cae7

Please sign in to comment.