code: @Override
  	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  		Drawable drawable = getDrawable();
  		if (getDrawable() != null) {
  			if (ratioType == RATIO_WIDTH) {
  				int width = MeasureSpec.getSize(widthMeasureSpec);
  				int height = Math.round(width * (((float) drawable.getIntrinsicHeight()) / ((float) drawable.getIntrinsicWidth())));
  				setMeasuredDimension(width, height);
  			} else if (ratioType == RATIO_HEIGHT) {
  				int height = MeasureSpec.getSize(heightMeasureSpec);
  				int width = Math.round(height * ((float) drawable.getIntrinsicWidth()) / ((float) drawable.getIntrinsicHeight()));
  				setMeasuredDimension(width, height);
  			}
  		} else {
  			super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  		}
  	}
docs: Maintain Image Aspect Ratio no matter the size