showPreviousが呼び出されたときにビューアニメーションを実行するViewFlipperがあります。アニメーションはうまくいきます。しかし、問題は、1秒以上の遅延で開始することです。今ではそれほど多くはないようですが、アプリの使用が大幅に遅れます。
私のアニメーションは次のようになります。
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());
setInAnimation
とを使用してアニメーションを設定しましたsetOutAnimation
;
setInAnimation(inFromLeft);
setOutAnimation(outtoRight);
次に、を使用してアニメーションを起動しますshowPrevious
アニメーションが1秒以上の遅延で開始し、アニメーションのstartTimeが-1で、startOffsetが0である理由はありますか。