ViewFlipper having 'huge' delay

Viewed 607

I have a ViewFlipper which runs a view animation when showPrevious is called. The animation works out fine. But the problem is it starts with a delay of over 1 seconds. Now this doesn't seem like much but it seriously delays usage of the app.

My animations look like this;

Animation inFromLeft = new TranslateAnimation(
    Animation.RELATIVE_TO_PARENT, -1.0f,
    Animation.RELATIVE_TO_PARENT, 0.0f,
    Animation.RELATIVE_TO_PARENT, 0.0f,
    Animation.RELATIVE_TO_PARENT, 0.0f);
inFromLeft.setDuration(350);
inFromLeft.setInterpolator(new LinearInterpolator());   

Animation outtoRight = new TranslateAnimation(
    Animation.RELATIVE_TO_PARENT, 0.0f,
    Animation.RELATIVE_TO_PARENT, +1.0f,
    Animation.RELATIVE_TO_PARENT, 0.0f,
    Animation.RELATIVE_TO_PARENT, 0.0f);
outtoRight.setDuration(350);
outtoRight.setInterpolator(new LinearInterpolator());

I set the animations using setInAnimation and setOutAnimation;

setInAnimation(inFromLeft);
setOutAnimation(outtoRight);

And then I just launch the animation using showPrevious

Is there any reason why the animations starts with a delay of over 1 seconds, the startTime for the animations is -1 and the startOffset is 0.

3 Answers
Related