protected int onMeasureDimension(int min,int measureSpec){
switch (MeasureSpec.getMode(measureSpec)) {
case MeasureSpec.EXACTLY:
    return MeasureSpec.getSize(measureSpec);
case MeasureSpec.AT_MOST:
  return Math.min(min,MeasureSpec.getSize(measureSpec));
case MeasureSpec.UNSPECIFIED:
default :
return min;
}
}

protected int onMeasureDimension ( int min , int measureSpec ) { switch ( MeasureSpec . getMode ( measureSpec ) ) { case MeasureSpec . EXACTLY : return MeasureSpec . getSize ( measureSpec ) ; case MeasureSpec . AT_MOST : return Math . min ( min , MeasureSpec . getSize ( measureSpec ) ) ; case MeasureSpec . UNSPECIFIED : default : return min ; } }
calculates the measured dimension in a single direction ( width or height ) .
