Ejemplo n.º 1
0
 @Override
 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
   if (mHeightRatio > 0.0) {
     int width = MeasureSpec.getSize(widthMeasureSpec);
     int height = (int) (width * mHeightRatio);
     super.setMeasuredDimension(width, height);
   } else {
     super.onMeasure(widthMeasureSpec, heightMeasureSpec);
   }
 }