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]) { layoutValid[minorAxis] = false; span[minorAxis] = newSpan[minorAxis]; layoutMinorAxis(span[minorAxis], minorAxis, offsets[minorAxis], spans[minorAxis]);   for (int i = 0; i < count; ++i) { getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);
layoutAxis(X_AXIS, width); layoutAxis(Y_AXIS, height);
  protected void layout(int width, int height)  {    int[] newSpan = new int[]{ width, height };    int count = getViewCount();    // Update minor axis as appropriate. We need to first update the minor    // axis layout because that might affect the children's preferences along    // the major axis.    int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS;    if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis])      {        layoutValid[minorAxis] = false;        span[minorAxis] = newSpan[minorAxis];        layoutMinorAxis(span[minorAxis], minorAxis, offsets[minorAxis],                        spans[minorAxis]);        // Update the child view's sizes.        for (int i = 0; i < count; ++i)          {            getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);          }        layoutValid[minorAxis] = true;      }    // Update major axis as appropriate.    if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis])      {        layoutValid[myAxis] = false;        span[myAxis] = newSpan[myAxis];        layoutMajorAxis(span[myAxis], myAxis, offsets[myAxis],                        spans[myAxis]);        // Update the child view's sizes.        for (int i = 0; i < count; ++i)          {            getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);          }        layoutValid[myAxis] = true;      }    if (layoutValid[myAxis] == false)	  System.err.println("WARNING: Major axis layout must be valid after layout");    if (layoutValid[minorAxis] == false)      System.err.println("Minor axis layout must be valid after layout");  }