/** * The most recent value calculated by this <code>ValueAnimator</code> when there is just one * property being animated. This value is only sensible while the animation is running. The main * purpose for this read-only property is to retrieve the value from the <code>ValueAnimator</code> * during a call to {@link AnimatorUpdateListener#onAnimationUpdate(ValueAnimator)}, which * is called during each animation frame, immediately after the value is calculated. * * @return animatedValue The value most recently calculated by this <code>ValueAnimator</code> for * the single property being animated. If there are several properties being animated * (specified by several PropertyValuesHolder objects in the constructor), this function * returns the animated value for the first of those objects. */ public Object getAnimatedValue() { if (mValues != null && mValues.length > 0) { return mValues[0].getAnimatedValue(); } // Shouldn't get here; should always have values unless ValueAnimator was set up wrong return null; }
/** * The most recent value calculated by this <code>ValueAnimator</code> when there is just one * property being animated. This value is only sensible while the animation is running. The main * purpose for this read-only property is to retrieve the value from the <code>ValueAnimator</code> * during a call to {@link AnimatorUpdateListener#onAnimationUpdate(ValueAnimator)}, which * is called during each animation frame, immediately after the value is calculated. * * @return animatedValue The value most recently calculated by this <code>ValueAnimator</code> for * the single property being animated. If there are several properties being animated * (specified by several PropertyValuesHolder objects in the constructor), this function * returns the animated value for the first of those objects. */ public Object getAnimatedValue() { if (mValues != null && mValues.length > 0) { return mValues[0].getAnimatedValue(); } // Shouldn't get here; should always have values unless ValueAnimator was set up wrong return null; }
/** * The most recent value calculated by this <code>ValueAnimator</code> for <code>propertyName</code>. * The main purpose for this read-only property is to retrieve the value from the * <code>ValueAnimator</code> during a call to * {@link AnimatorUpdateListener#onAnimationUpdate(ValueAnimator)}, which * is called during each animation frame, immediately after the value is calculated. * * @return animatedValue The value most recently calculated for the named property * by this <code>ValueAnimator</code>. */ public Object getAnimatedValue(String propertyName) { PropertyValuesHolder valuesHolder = mValuesMap.get(propertyName); if (valuesHolder != null) { return valuesHolder.getAnimatedValue(); } else { // At least avoid crashing if called with bogus propertyName return null; } }
/** * The most recent value calculated by this <code>ValueAnimator</code> for <code>propertyName</code>. * The main purpose for this read-only property is to retrieve the value from the * <code>ValueAnimator</code> during a call to * {@link AnimatorUpdateListener#onAnimationUpdate(ValueAnimator)}, which * is called during each animation frame, immediately after the value is calculated. * * @return animatedValue The value most recently calculated for the named property * by this <code>ValueAnimator</code>. */ public Object getAnimatedValue(String propertyName) { PropertyValuesHolder valuesHolder = mValuesMap.get(propertyName); if (valuesHolder != null) { return valuesHolder.getAnimatedValue(); } else { // At least avoid crashing if called with bogus propertyName return null; } }
/** * Internal function to set the value on the target object, using the setter set up * earlier on this PropertyValuesHolder object. This function is called by ObjectAnimator * to handle turning the value calculated by ValueAnimator into a value set on the object * according to the name of the property. * @param target The target object on which the value is set */ void setAnimatedValue(Object target) { //if (mProperty != null) { // mProperty.set(target, getAnimatedValue()); //} if (mSetter != null) { try { mTmpValueArray[0] = getAnimatedValue(); mSetter.invoke(target, mTmpValueArray); } catch (InvocationTargetException e) { Log.e("PropertyValuesHolder", e.toString()); } catch (IllegalAccessException e) { Log.e("PropertyValuesHolder", e.toString()); } } }
/** * Internal function to set the value on the target object, using the setter set up * earlier on this PropertyValuesHolder object. This function is called by ObjectAnimator * to handle turning the value calculated by ValueAnimator into a value set on the object * according to the name of the property. * @param target The target object on which the value is set */ void setAnimatedValue(Object target) { //if (mProperty != null) { // mProperty.set(target, getAnimatedValue()); //} if (mSetter != null) { try { mTmpValueArray[0] = getAnimatedValue(); mSetter.invoke(target, mTmpValueArray); } catch (InvocationTargetException e) { Log.e("PropertyValuesHolder", e.toString()); } catch (IllegalAccessException e) { Log.e("PropertyValuesHolder", e.toString()); } } }