android的动画插值器做出来的动画那叫一个炫酷,但是我只找到怎么在animation和属性动画里使用,不知道能不能在Scroller里使用插值器,也就是自定义viewGroup的时候使用scroller来实现动画时使用插值器做一些炫酷的动画效果。求问
可以,继承Interpolatort自己实现,然后在Scroller初始化时去使用
public Scroller(Context context, Interpolator interpolator, boolean flywheel) {
mFinished = true;
if (interpolator == null) {
mInterpolator = new ViscousFluidInterpolator();
} else {
mInterpolator = interpolator;
}
mPpi = context.getResources().getDisplayMetrics().density * 160.0f;
mDeceleration = computeDeceleration(ViewConfiguration.getScrollFriction());
mFlywheel = flywheel;
mPhysicalCoeff = computeDeceleration(0.84f); // look and feel tuning
}