rotate animation in android -


i'm creating wheel rotating animation automatically run when run app...i want rotate 90 degrees , pause while rotate 90 degrees again until reach 360%...here's code::

public void start(){     rotateanimation counterspinw = new rotateanimation(0f, 90f, 50,50);     counterspinw.setrepeatmode(1);     counterspinw.getfillafter();     counterspinw.setduration(8000);      counterspinw.setinterpolator(new linearinterpolator());    biglayout.startanimation(counterspinw);     rotateanimation counterspinw2 = new rotateanimation(0f, 90f, 50,50);    counterspinw2.setrepeatmode(1);    counterspinw2.getfillafter();    counterspinw2.setduration(8000);    counterspinw2.setinterpolator(new linearinterpolator());   biglayout.startanimation(counterspinw2);    rotateanimation counterspinw3 = new rotateanimation(0f, 90f, 50,50);   counterspinw3.setrepeatmode(1);   counterspinw3.getfillafter();   counterspinw3.setduration(8000);   counterspinw3.setinterpolator(new linearinterpolator());  biglayout.startanimation(counterspinw3);   rotateanimation counterspinw4 = new rotateanimation(0f, 90f, 50,50);  counterspinw4.setrepeatmode(-1);  counterspinw4.getfillafter();  counterspinw4.setduration(8000);  counterspinw4.setinterpolator(new linearinterpolator()); biglayout.startanimation(counterspinw4); 

i think maybe won't work..but never tested yet....

you should use setstartoffset()

firstrotateanimation.setstartoffset(0); pauseanimation.setstartoffset(8000); newrotateanimation.setstartoffset(16000); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -