Loading core/java/android/animation/FloatKeyframeSet.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ class FloatKeyframeSet extends KeyframeSet { return newSet; } @Override void invalidateCache() { firstTime = true; } public float getFloatValue(float fraction) { if (mNumKeyframes == 2) { if (firstTime) { Loading core/java/android/animation/IntKeyframeSet.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ class IntKeyframeSet extends KeyframeSet { return newSet; } @Override void invalidateCache() { firstTime = true; } public int getIntValue(float fraction) { if (mNumKeyframes == 2) { if (firstTime) { Loading core/java/android/animation/Keyframe.java +33 −7 Original line number Diff line number Diff line Loading @@ -34,6 +34,20 @@ package android.animation; * types have lower runtime overhead than other types.</p> */ public abstract class Keyframe implements Cloneable { /** * Flag to indicate whether this keyframe has a valid value. This flag is used when an * animation first starts, to populate placeholder keyframes with real values derived * from the target object. */ boolean mHasValue; /** * Flag to indicate whether the value in the keyframe was read from the target object or not. * If so, its value will be recalculated if target changes. */ boolean mValueWasSetOnStart; /** * The time at which mValue will hold true. */ Loading @@ -51,12 +65,7 @@ public abstract class Keyframe implements Cloneable { */ private TimeInterpolator mInterpolator = null; /** * Flag to indicate whether this keyframe has a valid value. This flag is used when an * animation first starts, to populate placeholder keyframes with real values derived * from the target object. */ boolean mHasValue = false; /** * Constructs a Keyframe object with the given time and value. The time defines the Loading Loading @@ -165,6 +174,20 @@ public abstract class Keyframe implements Cloneable { return mHasValue; } /** * If the Keyframe's value was acquired from the target object, this flag should be set so that, * if target changes, value will be reset. * * @return boolean Whether this Keyframe's value was retieved from the target object or not. */ boolean valueWasSetOnStart() { return mValueWasSetOnStart; } void setValueWasSetOnStart(boolean valueWasSetOnStart) { mValueWasSetOnStart = valueWasSetOnStart; } /** * Gets the value for this Keyframe. * Loading Loading @@ -261,7 +284,8 @@ public abstract class Keyframe implements Cloneable { @Override public ObjectKeyframe clone() { ObjectKeyframe kfClone = new ObjectKeyframe(getFraction(), mHasValue ? mValue : null); ObjectKeyframe kfClone = new ObjectKeyframe(getFraction(), hasValue() ? mValue : null); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; kfClone.setInterpolator(getInterpolator()); return kfClone; } Loading Loading @@ -310,6 +334,7 @@ public abstract class Keyframe implements Cloneable { new IntKeyframe(getFraction(), mValue) : new IntKeyframe(getFraction()); kfClone.setInterpolator(getInterpolator()); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; return kfClone; } } Loading Loading @@ -356,6 +381,7 @@ public abstract class Keyframe implements Cloneable { new FloatKeyframe(getFraction(), mValue) : new FloatKeyframe(getFraction()); kfClone.setInterpolator(getInterpolator()); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; return kfClone; } } Loading core/java/android/animation/KeyframeSet.java +7 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,13 @@ class KeyframeSet { mInterpolator = mLastKeyframe.getInterpolator(); } /** * If subclass has variables that it calculates based on the Keyframes, it should reset them * when this method is called because Keyframe contents might have changed. */ void invalidateCache() { } public static KeyframeSet ofInt(int... values) { int numKeyframes = values.length; IntKeyframe keyframes[] = new IntKeyframe[Math.max(numKeyframes,2)]; Loading core/java/android/animation/ObjectAnimator.java +1 −4 Original line number Diff line number Diff line Loading @@ -883,10 +883,7 @@ public final class ObjectAnimator extends ValueAnimator { final Object oldTarget = getTarget(); if (oldTarget != target) { mTarget = target == null ? null : new WeakReference<Object>(target); if (oldTarget != null && target != null && oldTarget.getClass() == target.getClass()) { return; } // New target type should cause re-initialization prior to starting // New target should cause re-initialization prior to starting mInitialized = false; } } Loading Loading
core/java/android/animation/FloatKeyframeSet.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ class FloatKeyframeSet extends KeyframeSet { return newSet; } @Override void invalidateCache() { firstTime = true; } public float getFloatValue(float fraction) { if (mNumKeyframes == 2) { if (firstTime) { Loading
core/java/android/animation/IntKeyframeSet.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,11 @@ class IntKeyframeSet extends KeyframeSet { return newSet; } @Override void invalidateCache() { firstTime = true; } public int getIntValue(float fraction) { if (mNumKeyframes == 2) { if (firstTime) { Loading
core/java/android/animation/Keyframe.java +33 −7 Original line number Diff line number Diff line Loading @@ -34,6 +34,20 @@ package android.animation; * types have lower runtime overhead than other types.</p> */ public abstract class Keyframe implements Cloneable { /** * Flag to indicate whether this keyframe has a valid value. This flag is used when an * animation first starts, to populate placeholder keyframes with real values derived * from the target object. */ boolean mHasValue; /** * Flag to indicate whether the value in the keyframe was read from the target object or not. * If so, its value will be recalculated if target changes. */ boolean mValueWasSetOnStart; /** * The time at which mValue will hold true. */ Loading @@ -51,12 +65,7 @@ public abstract class Keyframe implements Cloneable { */ private TimeInterpolator mInterpolator = null; /** * Flag to indicate whether this keyframe has a valid value. This flag is used when an * animation first starts, to populate placeholder keyframes with real values derived * from the target object. */ boolean mHasValue = false; /** * Constructs a Keyframe object with the given time and value. The time defines the Loading Loading @@ -165,6 +174,20 @@ public abstract class Keyframe implements Cloneable { return mHasValue; } /** * If the Keyframe's value was acquired from the target object, this flag should be set so that, * if target changes, value will be reset. * * @return boolean Whether this Keyframe's value was retieved from the target object or not. */ boolean valueWasSetOnStart() { return mValueWasSetOnStart; } void setValueWasSetOnStart(boolean valueWasSetOnStart) { mValueWasSetOnStart = valueWasSetOnStart; } /** * Gets the value for this Keyframe. * Loading Loading @@ -261,7 +284,8 @@ public abstract class Keyframe implements Cloneable { @Override public ObjectKeyframe clone() { ObjectKeyframe kfClone = new ObjectKeyframe(getFraction(), mHasValue ? mValue : null); ObjectKeyframe kfClone = new ObjectKeyframe(getFraction(), hasValue() ? mValue : null); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; kfClone.setInterpolator(getInterpolator()); return kfClone; } Loading Loading @@ -310,6 +334,7 @@ public abstract class Keyframe implements Cloneable { new IntKeyframe(getFraction(), mValue) : new IntKeyframe(getFraction()); kfClone.setInterpolator(getInterpolator()); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; return kfClone; } } Loading Loading @@ -356,6 +381,7 @@ public abstract class Keyframe implements Cloneable { new FloatKeyframe(getFraction(), mValue) : new FloatKeyframe(getFraction()); kfClone.setInterpolator(getInterpolator()); kfClone.mValueWasSetOnStart = mValueWasSetOnStart; return kfClone; } } Loading
core/java/android/animation/KeyframeSet.java +7 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,13 @@ class KeyframeSet { mInterpolator = mLastKeyframe.getInterpolator(); } /** * If subclass has variables that it calculates based on the Keyframes, it should reset them * when this method is called because Keyframe contents might have changed. */ void invalidateCache() { } public static KeyframeSet ofInt(int... values) { int numKeyframes = values.length; IntKeyframe keyframes[] = new IntKeyframe[Math.max(numKeyframes,2)]; Loading
core/java/android/animation/ObjectAnimator.java +1 −4 Original line number Diff line number Diff line Loading @@ -883,10 +883,7 @@ public final class ObjectAnimator extends ValueAnimator { final Object oldTarget = getTarget(); if (oldTarget != target) { mTarget = target == null ? null : new WeakReference<Object>(target); if (oldTarget != null && target != null && oldTarget.getClass() == target.getClass()) { return; } // New target type should cause re-initialization prior to starting // New target should cause re-initialization prior to starting mInitialized = false; } } Loading