onMeasure() now makes use of MeasureSpec properly to choose dimensions.