Code example for ObjectAnimator

Methods: setDuration, setIntValues

0
        int targetAngle = current.mStartAngle + (current.mEndAngle - current.mStartAngle) / 2;
        targetAngle -= mCurrentItemAngle;
        if (targetAngle < 90 && mChartRotation > 180) targetAngle += 360;
 
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            mAutoCenterAnimator.setIntValues(targetAngle);
            mAutoCenterAnimator.setDuration(AUTOCENTER_ANIM_DURATION).start();
        } 
 
    } 
 
    /** 
     * Calculate which pie chart slice is at the bottom, and set the current item 
     * field accordingly. 
     */ 
    private void calcCurrentItem() { 
        // 
        int pointerAngle = (mCurrentItemAngle + 360 + mChartRotation) % 360;
        // go through the slices and check 
        for (int i = 0; i < mData.size(); ++i) {
            ChartItem item = mData.get(i);