RectF
values.
*/
public class RectFEvaluator implements TypeEvaluatorfraction
representing the proportion
* between the start and end values. The calculation is a simple parametric
* calculation on each of the separate components in the Rect objects
* (left, top, right, and bottom).
*
* The object returned will be the reuseRect
passed into the constructor.
fraction
parameter.
*/
@Override
public RectF evaluate(float fraction, RectF startValue, RectF endValue) {
float left = startValue.left + ((endValue.left - startValue.left) * fraction);
float top = startValue.top + ((endValue.top - startValue.top) * fraction);
float right = startValue.right + ((endValue.right - startValue.right) * fraction);
float bottom = startValue.bottom + ((endValue.bottom - startValue.bottom) * fraction);
mRect.set(left, top, right, bottom);
return mRect;
}
}