Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ObjectAnimator.setDuration is ignored

The setDuration function of the ObjectAnimator class in Android appears to be completely ignored. No matter what value I pass it, the animation is always completed instantly.

    ObjectAnimator.ofFloat(mView, "translationY", 0, 100)
            .setDuration(2000)
            .start();

The above code increases the Y value of mView by 100 (essentially pushing it further down the screen). The actual translation occurs correctly, however it is instantaneous. The setDuration(2000) is completely ignored. Why is this?

EDIT:

This seemsto be based on the device - the samsung galaxy s4 appears to have an issue with interpolating views correctly. This is the same issue as this question.

like image 694
Mike Baxter Avatar asked Feb 10 '23 01:02

Mike Baxter


1 Answers

This turned out to be an issue with the default animation duration scale under Developer Options. I've answered a similar question here.

like image 68
Mike Baxter Avatar answered Feb 13 '23 16:02

Mike Baxter