/** * This method is called with the elapsed fraction of the animation during every * animation frame. This function turns the elapsed fraction into an interpolated fraction * and then into an animated value (from the evaluator. The function is called mostly during * animation updates, but it is also called when the <code>end()</code> * function is called, to set the final value on the property. * * <p>Overrides of this method must call the superclass to perform the calculation * of the animated value.</p> * * @param fraction The elapsed fraction of the animation. */ @Override void animateValue(float fraction) { super.animateValue(fraction); int numValues = mValues.length; for (int i = 0; i < numValues; ++i) { mValues[i].setAnimatedValue(mTarget); } }
/** * This method is called with the elapsed fraction of the animation during every * animation frame. This function turns the elapsed fraction into an interpolated fraction * and then into an animated value (from the evaluator. The function is called mostly during * animation updates, but it is also called when the <code>end()</code> * function is called, to set the final value on the property. * * <p>Overrides of this method must call the superclass to perform the calculation * of the animated value.</p> * * @param fraction The elapsed fraction of the animation. */ @Override void animateValue(float fraction) { super.animateValue(fraction); int numValues = mValues.length; for (int i = 0; i < numValues; ++i) { mValues[i].setAnimatedValue(mTarget); } }
@Override public void end() { if (!sAnimations.get().contains(this) && !sPendingAnimations.get().contains(this)) { // Special case if the animation has not yet started; get it ready for ending mStartedDelay = false; startAnimation(); } else if (!mInitialized) { initAnimation(); } // The final value set on the target varies, depending on whether the animation // was supposed to repeat an odd number of times if (mRepeatCount > 0 && (mRepeatCount & 0x01) == 1) { animateValue(0f); } else { animateValue(1f); } endAnimation(); }
@Override public void end() { if (!sAnimations.get().contains(this) && !sPendingAnimations.get().contains(this)) { // Special case if the animation has not yet started; get it ready for ending mStartedDelay = false; startAnimation(); } else if (!mInitialized) { initAnimation(); } // The final value set on the target varies, depending on whether the animation // was supposed to repeat an odd number of times if (mRepeatCount > 0 && (mRepeatCount & 0x01) == 1) { animateValue(0f); } else { animateValue(1f); } endAnimation(); }
fraction = 1f - fraction; animateValue(fraction); break;
fraction = 1f - fraction; animateValue(fraction); break;