ребята. у меня есть этот код (asyncTask)
моя функция анимации ():
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);// i want rotating without this <------------------
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
Может кто-нибудь сказать мне, что это можно сделать без anim.setDuration
????
только начать .. и когда я нажал на кнопку (например) анимация остановилась.
Пожалуйста, помогите мне.
С уважением, Питер.
окончательный код:
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);
// anim.setRepeatMode(Animation.INFINITE);
anim.setRepeatCount(Animation.INFINITE);
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
и где-то refresh.clearAnimation();
для остановки анимации
это идеально подходит для меня .. если здесь что-то не так - пожалуйста, скажите мне .. В любом случае, спасибо за ответы