Add InterpolatorUtils

This commit is contained in:
seven332 committed 2015-05-07 14:22:57 +08:00
1 parent a20565f1b2
commit 95a724e5d4
4 files changed
+36 -12

No files matched your search

@@ -23,8 +23,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v4.view.animation.FastOutLinearInInterpolator;
import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -32,12 +30,10 @@ import android.view.animation.Interpolator;
import com.hippo.animation.SimpleAnimatorListener;
import com.hippo.ehviewer.R;
import com.hippo.util.InterpolatorUtils;
public class FabLayout extends ViewGroup implements View.OnClickListener {
private final static Interpolator LINEAR_OUT_SLOW_IN_INTERPOLATOR = new LinearOutSlowInInterpolator();
private final static Interpolator FAST_OUT_LINEAR_IN_INTERPOLATOR = new FastOutLinearInInterpolator();
private static long ANIMATE_TIME = 300l;
private static final String STATE_KEY_SUPER = "super";
@@ -276,14 +272,14 @@ public class FabLayout extends ViewGroup implements View.OnClickListener {
endTranslationY = 0f;
startAlpha = 0f;
endAlpha = 1f;
interpolator = LINEAR_OUT_SLOW_IN_INTERPOLATOR;
interpolator = InterpolatorUtils.FAST_SLOW_INTERPOLATOR;
} else {
startTranslationY = 0f;
endTranslationY = mMainFabCenterY -
(child.getTop() + (child.getHeight() / 2));
startAlpha = 1f;
endAlpha = 0f;
interpolator = FAST_OUT_LINEAR_IN_INTERPOLATOR;
interpolator = InterpolatorUtils.SLOW_FAST_INTERPOLATOR;
}
PropertyValuesHolder translationYPvh = PropertyValuesHolder.ofFloat(