baselineLayout(width, X_AXIS, offsetsX, spansX); baselineLayout(height, Y_AXIS, offsetsY, spansY);
int[] newSpan = new int[]{ width, height }; int count = getViewCount();     int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS; if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis]) { requirements[minorAxis] = calculateMinorAxisRequirements(minorAxis, requirements[minorAxis]); layoutMinorAxis(newSpan[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]); span[myAxis] = newSpan[myAxis];   for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[minorAxis] = true; }    if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis]) { requirements[myAxis] = calculateMajorAxisRequirements(myAxis, requirements[myAxis]); layoutMajorAxis(newSpan[myAxis], myAxis, offsets[myAxis], spans[myAxis]); span[myAxis] = newSpan[myAxis];   for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]); } layoutValid[myAxis] = true; }   assert layoutValid[myAxis] == true : "Major axis layout must be valid after layout"; assert layoutValid[minorAxis] == true : "Minor axis layout must be valid after layout";
  protected void layout(int width, int height)  {    baselineLayout(width, X_AXIS, offsetsX, spansX);    baselineLayout(height, Y_AXIS, offsetsY, spansY);  }