OSDN Git Service

More refactor on ValueAnimator
authorDoris Liu <tianliu@google.com>
Wed, 9 Sep 2015 21:52:59 +0000 (14:52 -0700)
committerDoris Liu <tianliu@google.com>
Fri, 9 Oct 2015 01:40:05 +0000 (18:40 -0700)
commitfbe94ece70c8064e9d9d6f6c278bb9ab310911cd
treeec9491a6460440378e926ec0a661d70f2e2e9a79
parent8b14288c940d8edf463a54fe7ab9f326e45f03be
More refactor on ValueAnimator

mPlayingBackwards is confusing when placed next to mReversing.
One means the overall direction of animation playing, the other
indicates the direction of playing in the current iteration.

mCurrentIteration and mPlayingBackward are redundant together,
as the latter can be derived from the former, given the overall
direction of animation playing. Redundant variables pose risk of
getting out of sync and therefore are refactored out in this CL.
Instead, an overall fraction that ranges from 0 to mRepeatCount + 1
was introduced. It can capture both the current iteration and the
fraction in the current iteration. It gives a much better idea of
the overall progress of the animation.

Change-Id: Ic0ea02c86b04cfc01c462687d1ebbd46184cbab7
core/java/android/animation/ValueAnimator.java