fm/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
private void tryComputeMaxWidth() {
        if (!mComputeMaxWidth) {
            return;
        }
        int maxTextWidth = 0;
        if (mDisplayedValues == null) {
            float maxDigitWidth = 0;
            for (int i = 0; i <= 9; i++) {
                final float digitWidth = mSelectorWheelPaint.measureText(String
                        .valueOf(i));
                if (digitWidth > maxDigitWidth) {
                    maxDigitWidth = digitWidth;
                }
            }
            int numberOfDigits = 0;
            int current = mMaxValue;
            while (current > 0) {
                numberOfDigits++;
                current = current / 10;
            }
            maxTextWidth = (int) (numberOfDigits * maxDigitWidth);
        } else {
            final int valueCount = mDisplayedValues.length;
            for (int i = 0; i < valueCount; i++) {
                final float textWidth = mSelectorWheelPaint
                        .measureText(mDisplayedValues[i]);
                if (textWidth > maxTextWidth) {
                    maxTextWidth = (int) textWidth;
                }
            }
        }
//        maxTextWidth += mInputText.getPaddingLeft()
//                + mInputText.getPaddingRight();
        if (mMaxWidth != maxTextWidth) {
            if (maxTextWidth > mMinWidth) {
                mMaxWidth = maxTextWidth;
            } else {
                mMaxWidth = mMinWidth;
            }
            invalidate();
        }
    }
/**
     * Computes the max width if no such specified as an attribute.
     */
Computes the max width if no such specified as an attribute.
Computes the max width if no such specified as an attribute .
private void tryComputeMaxWidth() {
        if (!mComputeMaxWidth) {
            return;
        }
        int maxTextWidth = 0;
        if (mDisplayedValues == null) {
            float maxDigitWidth = 0;
            for (int i = 0; i <= 9; i++) {
                final float digitWidth = mSelectorWheelPaint.measureText(String
                        .valueOf(i));
                if (digitWidth > maxDigitWidth) {
                    maxDigitWidth = digitWidth;
                }
            }
            int numberOfDigits = 0;
            int current = mMaxValue;
            while (current > 0) {
                numberOfDigits++;
                current = current / 10;
            }
            maxTextWidth = (int) (numberOfDigits * maxDigitWidth);
        } else {
            final int valueCount = mDisplayedValues.length;
            for (int i = 0; i < valueCount; i++) {
                final float textWidth = mSelectorWheelPaint
                        .measureText(mDisplayedValues[i]);
                if (textWidth > maxTextWidth) {
                    maxTextWidth = (int) textWidth;
                }
            }
        }
        if (mMaxWidth != maxTextWidth) {
            if (maxTextWidth > mMinWidth) {
                mMaxWidth = maxTextWidth;
            } else {
                mMaxWidth = mMinWidth;
            }
            invalidate();
        }
    }
private void tryComputeMaxWidth ( ) { if ( ! mComputeMaxWidth ) { return ; } int maxTextWidth = 0 ; if ( mDisplayedValues == null ) { float maxDigitWidth = 0 ; for ( int i = 0 ; i <= 9 ; i ++ ) { final float digitWidth = mSelectorWheelPaint . measureText ( String . valueOf ( i ) ) ; if ( digitWidth > maxDigitWidth ) { maxDigitWidth = digitWidth ; } } int numberOfDigits = 0 ; int current = mMaxValue ; while ( current > 0 ) { numberOfDigits ++ ; current = current / 10 ; } maxTextWidth = ( int ) ( numberOfDigits * maxDigitWidth ) ; } else { final int valueCount = mDisplayedValues . length ; for ( int i = 0 ; i < valueCount ; i ++ ) { final float textWidth = mSelectorWheelPaint . measureText ( mDisplayedValues [ i ] ) ; if ( textWidth > maxTextWidth ) { maxTextWidth = ( int ) textWidth ; } } } if ( mMaxWidth != maxTextWidth ) { if ( maxTextWidth > mMinWidth ) { mMaxWidth = maxTextWidth ; } else { mMaxWidth = mMinWidth ; } invalidate ( ) ; } }
Computes the max width if no such specified as an attribute.
Computes the max width if no such specified as an attribute .
//        maxTextWidth += mInputText.getPaddingLeft() //                + mInputText.getPaddingRight();