Code example for ValueAnimator

Methods: getAnimatedFraction

0
    @Override 
    public void onAnimationUpdate(ValueAnimator animation) {
        int alpha = (int) (255 * animation.getAnimatedFraction());
        mClockPaint.setAlpha(alpha);
        mInfoPaint.setAlpha(alpha);
 
        // if we are going to get displayed update data 
        if (alpha > 0 && mStaleData) {
            updateData(); 
            mStaleData = false;
        } 
    } 
 
    private Path updatePath(Path path, float radius, float start, float sweep) {
        if (path == null) {
            path = new Path();
        } else { 
            path.reset();
        } 
 
        final RectF bB = new RectF(-radius, -radius, radius, radius);