OSDN Git Service

Reapply animation duration scale each time it is started.
authorJeff Brown <jeffbrown@google.com>
Tue, 7 Oct 2014 22:55:35 +0000 (15:55 -0700)
committerJeff Brown <jeffbrown@google.com>
Tue, 7 Oct 2014 22:55:35 +0000 (15:55 -0700)
commit7a08fe0e09c9bd5b66049738617cc9972651bf5b
tree50d8e55555e0eec764c0acd9c7b9565397741d2c
parent99586dc0108d0f4311c8af4d06ed113bbf40a6ee
Reapply animation duration scale each time it is started.

When Battery Saver mode is enabled, we set the animation duration
scale factor to 0 to effectively disable all animations.  Later
when it is disabled, we reset the animation duration scale
factor to 1.

This change ensures that we reapply the duration scale factor
whenever the animation is started instead of only applying it
once when the duration is set (usually when the animation is
created).  This ensures that the correct scale factor is applied
even when it changes after the animation has been initialized.

Previously, certain animations would continue to be suppressed
even after Battery Saver mode was disengaged.  This wasn't much
of an issue when the duration scale was initially implemented as
a developer setting but now that it is exposed via Battery Saver
the artifacts caused by this bug have become visible to users.

Bug: 17887431
Change-Id: I91ba5ca0505d02ac389a31d067e38886112fa0c8
core/java/android/animation/ValueAnimator.java