Code example for ObjectAnimator

Methods: setDuration, setIntValues

0
        targetAngle -= mCurrentItemAngle;
        if (targetAngle < 90 && mPieRotation > 180) targetAngle += 360;
 
        if (Build.VERSION.SDK_INT >= 11) {
            // Fancy animated version 
            mAutoCenterAnimator.setIntValues(targetAngle);
            mAutoCenterAnimator.setDuration(AUTOCENTER_ANIM_DURATION).start();
        } else { 
            // Dull non-animated version 
            //mPieView.rotateTo(targetAngle); 
        } 
    } 
 
    /** 
     * Internal child class that draws the pie chart onto a separate hardware layer 
     * when necessary. 
     */ 
    private class PieView extends View {
        private static final String TAG = "PieView Tag";
		// Used for SDK < 11 
        private float mRotation = 0;