自定义动画文件
public class Rotate3dAnimation extends Animation
{
}
使用方式 Activity
{
// 计算中心点
final float centerX = iv_Logo.getWidth() / 2.0f;
final float centerY = iv_Logo.getHeight() / 2.0f;
// Create a new 3D rotation with the supplied parameter
// The animation listener is used to trigger the next animation
int start = 0;
int end = 360;
final Rotate3dAnimation rotation =new Rotate3dAnimation(start, end, centerX, centerY, 0.0f, true);
rotation.setDuration(2000);
rotation.setFillAfter(true);
rotation.setInterpolator(new AccelerateInterpolator());
//│ᅱᅢᄐ¢ᅩ�
rotation.setAnimationListener(new DisplayNextView());
iv_Logo.startAnimation(rotation);
}
private final class DisplayNextView implements AnimationListener
{
private DisplayNextView()
{
}
@Override
public void onAnimationEnd(Animation animation)
{
applyRotation();
}
@Override
public void onAnimationRepeat(Animation animation)
{
}
@Override
public void onAnimationStart(Animation animation)
{
}
}