    protected void onLayout(
            boolean changed, int left, int top, int right, int bottom) {
        int count = getChildCount();
        if (count == 0) return;
        int shutterButtonWidth = mShutterButton.getMeasuredWidth();
        mShutterButtonRadius = shutterButtonWidth / 2.0;
        int shutterButtonHeight = mShutterButton.getMeasuredHeight();
        mCenterY = (bottom - top) / 2;
        mShutterButton.layout(mCenterX - shutterButtonWidth / 2,
                mCenterY - shutterButtonHeight / 2,
                mCenterX + shutterButtonWidth / 2,
                mCenterY + shutterButtonHeight / 2);
        if (count == 1) return;
        mWheelRadius = mShutterButtonRadius + mStrokeWidth * 1.5;
        mCenterX = (int) (right - mShutterButtonRadius * 1.2);
        double intervalDegrees = 180.0 / (count - 2);
        double initialDegrees = 90.0;
        int index = 0;
        for (int i = 0; i < count; i++) {
            View view = getChildAt(i);
            if (view == mShutterButton) continue;
            double degree = initialDegrees + intervalDegrees * index;
            double radian = Math.toRadians(degree);
            int x = mCenterX + (int)(mWheelRadius * Math.cos(radian));
            int y = mCenterY - (int)(mWheelRadius * Math.sin(radian));
            int width = view.getMeasuredWidth();
            int height = view.getMeasuredHeight();
            view.layout(x - width / 2, y - height / 2, x + width / 2,
                    y + height / 2);
            index++;
        }
        mSectorInitialRadians = new double[count];
        mSectorInitialRadians[0] = Math.toRadians(
                initialDegrees - intervalDegrees / 2.0);
        for (int i = 1; i < count; i++) {
            mSectorInitialRadians[i] = mSectorInitialRadians[i - 1]
                    + Math.toRadians(intervalDegrees);
        }
    }

    protected void onLayout(
            boolean changed, int left, int top, int right, int bottom) {
        int count = getChildCount();
        if (count == 0) return;
        int shutterButtonWidth = mShutterButton.getMeasuredWidth();
        mShutterButtonRadius = shutterButtonWidth / 2.0;
        int shutterButtonHeight = mShutterButton.getMeasuredHeight();
        mCenterY = (bottom - top) / 2;
        mShutterButton.layout(mCenterX - shutterButtonWidth / 2,
                mCenterY - shutterButtonHeight / 2,
                mCenterX + shutterButtonWidth / 2,
                mCenterY + shutterButtonHeight / 2);
        if (count == 1) return;
        mWheelRadius = mShutterButtonRadius + mStrokeWidth * 1.5;
        mCenterX = (int) (right - mShutterButtonRadius * 1.2 - left);
        double intervalDegrees = 180.0 / (count - 2);
        double initialDegrees = 90.0;
        int index = 0;
        for (int i = 0; i < count; i++) {
            View view = getChildAt(i);
            if (view == mShutterButton) continue;
            double degree = initialDegrees + intervalDegrees * index;
            double radian = Math.toRadians(degree);
            int x = mCenterX + (int)(mWheelRadius * Math.cos(radian));
            int y = mCenterY - (int)(mWheelRadius * Math.sin(radian));
            int width = view.getMeasuredWidth();
            int height = view.getMeasuredHeight();
            view.layout(x - width / 2, y - height / 2, x + width / 2,
                    y + height / 2);
            index++;
        }
        mSectorInitialRadians = new double[count];
        mSectorInitialRadians[0] = Math.toRadians(
                initialDegrees - intervalDegrees / 2.0);
        for (int i = 1; i < count; i++) {
            mSectorInitialRadians[i] = mSectorInitialRadians[i - 1]
                    + Math.toRadians(intervalDegrees);
        }
    }
