fm/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
private int makeMeasureSpec(int measureSpec, int maxSize) {
        if (maxSize == SIZE_UNSPECIFIED) {
            return measureSpec;
        }
        final int size = MeasureSpec.getSize(measureSpec);
        final int mode = MeasureSpec.getMode(measureSpec);
        switch (mode) {
        case MeasureSpec.EXACTLY:
            return measureSpec;
        case MeasureSpec.AT_MOST:
            return MeasureSpec.makeMeasureSpec(Math.min(size, maxSize),
                    MeasureSpec.EXACTLY);
        case MeasureSpec.UNSPECIFIED:
            return MeasureSpec.makeMeasureSpec(maxSize, MeasureSpec.EXACTLY);
        default:
            throw new IllegalArgumentException("Unknown measure mode: " + mode);
        }
    }
/**
     * Makes a measure spec that tries greedily to use the max value.
     *
     * @param measureSpec
     *            The measure spec.
     * @param maxSize
     *            The max value for the size.
     * @return A measure spec greedily imposing the max size.
     */
Makes a measure spec that tries greedily to use the max value.
@param measureSpec
The measure spec.
@param maxSize
The max value for the size.
@return A measure spec greedily imposing the max size.
Makes a measure spec that tries greedily to use the max value . @param measureSpec The measure spec . @param maxSize The max value for the size . @return A measure spec greedily imposing the max size .
private int makeMeasureSpec(int measureSpec, int maxSize) {
        if (maxSize == SIZE_UNSPECIFIED) {
            return measureSpec;
        }
        final int size = MeasureSpec.getSize(measureSpec);
        final int mode = MeasureSpec.getMode(measureSpec);
        switch (mode) {
        case MeasureSpec.EXACTLY:
            return measureSpec;
        case MeasureSpec.AT_MOST:
            return MeasureSpec.makeMeasureSpec(Math.min(size, maxSize),
                    MeasureSpec.EXACTLY);
        case MeasureSpec.UNSPECIFIED:
            return MeasureSpec.makeMeasureSpec(maxSize, MeasureSpec.EXACTLY);
        default:
            throw new IllegalArgumentException("Unknown measure mode: " + mode);
        }
    }
private int makeMeasureSpec ( int measureSpec , int maxSize ) { if ( maxSize == SIZE_UNSPECIFIED ) { return measureSpec ; } final int size = MeasureSpec . getSize ( measureSpec ) ; final int mode = MeasureSpec . getMode ( measureSpec ) ; switch ( mode ) { case MeasureSpec . EXACTLY : return measureSpec ; case MeasureSpec . AT_MOST : return MeasureSpec . makeMeasureSpec ( Math . min ( size , maxSize ) , MeasureSpec . EXACTLY ) ; case MeasureSpec . UNSPECIFIED : return MeasureSpec . makeMeasureSpec ( maxSize , MeasureSpec . EXACTLY ) ; default : throw new IllegalArgumentException ( "Unknown measure mode: " + mode ) ; } }
Makes a measure spec that tries greedily to use the max value.
Makes a measure spec that tries greedily to use the max value .