if (firstTime) { firstTime = false; firstValue = ((IntKeyframe) mKeyframes.get(0)).getIntValue(); lastValue = ((IntKeyframe) mKeyframes.get(1)).getIntValue(); deltaValue = lastValue - firstValue; final IntKeyframe prevKeyframe = (IntKeyframe) mKeyframes.get(0); final IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(1); int prevValue = prevKeyframe.getIntValue(); int nextValue = nextKeyframe.getIntValue(); float prevFraction = prevKeyframe.getFraction(); float nextFraction = nextKeyframe.getFraction(); final /*Time*/Interpolator interpolator = nextKeyframe.getInterpolator(); if (interpolator != null) { fraction = interpolator.getInterpolation(fraction); final IntKeyframe prevKeyframe = (IntKeyframe) mKeyframes.get(mNumKeyframes - 2); final IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(mNumKeyframes - 1); int prevValue = prevKeyframe.getIntValue(); int nextValue = nextKeyframe.getIntValue(); float prevFraction = prevKeyframe.getFraction(); float nextFraction = nextKeyframe.getFraction(); final /*Time*/Interpolator interpolator = nextKeyframe.getInterpolator(); if (interpolator != null) { fraction = interpolator.getInterpolation(fraction); for (int i = 1; i < mNumKeyframes; ++i) { IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(i); if (fraction < nextKeyframe.getFraction()) {
if (firstTime) { firstTime = false; firstValue = ((IntKeyframe) mKeyframes.get(0)).getIntValue(); lastValue = ((IntKeyframe) mKeyframes.get(1)).getIntValue(); deltaValue = lastValue - firstValue; final IntKeyframe prevKeyframe = (IntKeyframe) mKeyframes.get(0); final IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(1); int prevValue = prevKeyframe.getIntValue(); int nextValue = nextKeyframe.getIntValue(); float prevFraction = prevKeyframe.getFraction(); float nextFraction = nextKeyframe.getFraction(); final /*Time*/Interpolator interpolator = nextKeyframe.getInterpolator(); if (interpolator != null) { fraction = interpolator.getInterpolation(fraction); final IntKeyframe prevKeyframe = (IntKeyframe) mKeyframes.get(mNumKeyframes - 2); final IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(mNumKeyframes - 1); int prevValue = prevKeyframe.getIntValue(); int nextValue = nextKeyframe.getIntValue(); float prevFraction = prevKeyframe.getFraction(); float nextFraction = nextKeyframe.getFraction(); final /*Time*/Interpolator interpolator = nextKeyframe.getInterpolator(); if (interpolator != null) { fraction = interpolator.getInterpolation(fraction); for (int i = 1; i < mNumKeyframes; ++i) { IntKeyframe nextKeyframe = (IntKeyframe) mKeyframes.get(i); if (fraction < nextKeyframe.getFraction()) {
/** * Constructs a Keyframe object with the given time. The value at this time will be derived * from the target object when the animation first starts (note that this implies that keyframes * with no initial value must be used as part of an {@link ObjectAnimator}). * The time defines the * time, as a proportion of an overall animation's duration, at which the value will hold true * for the animation. The value for the animation between keyframes will be calculated as * an interpolation between the values at those keyframes. * * @param fraction The time, expressed as a value between 0 and 1, representing the fraction * of time elapsed of the overall animation duration. */ public static Keyframe ofInt(float fraction) { return new IntKeyframe(fraction); }
/** * Constructs a Keyframe object with the given time and value. The time defines the * time, as a proportion of an overall animation's duration, at which the value will hold true * for the animation. The value for the animation between keyframes will be calculated as * an interpolation between the values at those keyframes. * * @param fraction The time, expressed as a value between 0 and 1, representing the fraction * of time elapsed of the overall animation duration. * @param value The value that the object will animate to as the animation time approaches * the time in this keyframe, and the the value animated from as the time passes the time in * this keyframe. */ public static Keyframe ofInt(float fraction, int value) { return new IntKeyframe(fraction, value); }
/** * Constructs a Keyframe object with the given time. The value at this time will be derived * from the target object when the animation first starts (note that this implies that keyframes * with no initial value must be used as part of an {@link ObjectAnimator}). * The time defines the * time, as a proportion of an overall animation's duration, at which the value will hold true * for the animation. The value for the animation between keyframes will be calculated as * an interpolation between the values at those keyframes. * * @param fraction The time, expressed as a value between 0 and 1, representing the fraction * of time elapsed of the overall animation duration. */ public static Keyframe ofInt(float fraction) { return new IntKeyframe(fraction); }
/** * Constructs a Keyframe object with the given time and value. The time defines the * time, as a proportion of an overall animation's duration, at which the value will hold true * for the animation. The value for the animation between keyframes will be calculated as * an interpolation between the values at those keyframes. * * @param fraction The time, expressed as a value between 0 and 1, representing the fraction * of time elapsed of the overall animation duration. * @param value The value that the object will animate to as the animation time approaches * the time in this keyframe, and the the value animated from as the time passes the time in * this keyframe. */ public static Keyframe ofInt(float fraction, int value) { return new IntKeyframe(fraction, value); }
@Override public IntKeyframe clone() { IntKeyframe kfClone = new IntKeyframe(getFraction(), mValue); kfClone.setInterpolator(getInterpolator()); return kfClone; } }
@Override public IntKeyframe clone() { IntKeyframe kfClone = new IntKeyframe(getFraction(), mValue); kfClone.setInterpolator(getInterpolator()); return kfClone; } }