List of usage examples for android.animation TimeInterpolator getInterpolation
float getInterpolation(float input);
From source file:com.taobao.weex.ui.animation.DimensionUpdateListener.java
@Override public void onAnimationUpdate(ValueAnimator animation) { if (view.getLayoutParams() != null) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); TimeInterpolator interpolator = animation.getInterpolator(); float fraction = animation.getAnimatedFraction(); int preWidth = layoutParams.width; int preHeight = layoutParams.height; if (width != null) { layoutParams.width = intEvaluator.evaluate(interpolator.getInterpolation(fraction), width.first, width.second);//from w w w .j a v a 2s .co m } if (height != null) { layoutParams.height = intEvaluator.evaluate(interpolator.getInterpolation(fraction), height.first, height.second); } if (preHeight != layoutParams.height || preWidth != layoutParams.width) { view.requestLayout(); } } }