public static int chooseAtLeastForOnMeasure(int minValue,int measureSpec){
  int specMode=MeasureSpec.getMode(measureSpec);
  int specSize=MeasureSpec.getSize(measureSpec);
  if (specMode == MeasureSpec.EXACTLY || specMode == MeasureSpec.AT_MOST && minValue > specSize)   return specSize;
  return minValue;
}

public static int chooseAtLeastForOnMeasure ( int minValue , int measureSpec ) { int specMode = MeasureSpec . getMode ( measureSpec ) ; int specSize = MeasureSpec . getSize ( measureSpec ) ; if ( specMode == MeasureSpec . EXACTLY || specMode == MeasureSpec . AT_MOST && minValue > specSize ) return specSize ; return minValue ; }
for view . onmeasure , chooses a measurement that is at least the given value , unless overridden by measure spec
