Ich habe einen ViewFlipper, der eine View-Animation ausführt, wenn showPrevious aufgerufen wird. Die Animation funktioniert gut. Aber das Problem ist, es beginnt mit einer Verzögerung von über 1 Sekunden. Jetzt scheint das nicht viel, aber es verzögert ernsthaft die Nutzung der App.ViewFlipper mit 'großer' Verzögerung
Meine Animationen sehen so aus;
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());
Ich habe die Animationen setInAnimation
und setOutAnimation
verwendet;
setInAnimation(inFromLeft);
setOutAnimation(outtoRight);
Und dann starte ich nur die Animation showPrevious
Gibt es einen Grund, warum verwenden die Animationen mit einer Verzögerung von mehr als 1 Sekunde beginnt, wird die Startzeit für die Animationen -1 und die startoffset 0.
Die Lösung wechselte zum ViewPager, die Animation ist nicht genau die, die ich wollte, aber die Verzögerung ist weg. Das Ändern der Animationen in XML hat nichts geändert. – Thys