offsetsY = newOffsetsY;
offsets[Y_AXIS] = newOffsetsY;
  public void replace(int offset, int length, View[] views)  {    // Resize and copy data for cache arrays.    // The spansX cache.    int oldSize = getViewCount();    int[] newSpansX = new int[oldSize - length + views.length];    System.arraycopy(spansX, 0, newSpansX, 0, offset);    System.arraycopy(spansX, offset + length, newSpansX,                     offset + views.length,                     oldSize - (offset + length));    spansX = newSpansX;    // The spansY cache.    int[] newSpansY = new int[oldSize - length + views.length];    System.arraycopy(spansY, 0, newSpansY, 0, offset);    System.arraycopy(spansY, offset + length, newSpansY,                     offset + views.length,                     oldSize - (offset + length));    spansY = newSpansY;    // The offsetsX cache.    int[] newOffsetsX = new int[oldSize - length + views.length];    System.arraycopy(offsetsX, 0, newOffsetsX, 0, offset);    System.arraycopy(offsetsX, offset + length, newOffsetsX,                     offset + views.length,                     oldSize - (offset + length));    offsetsX = newOffsetsX;    // The offsetsY cache.    int[] newOffsetsY = new int[oldSize - length + views.length];    System.arraycopy(offsetsY, 0, newOffsetsY, 0, offset);    System.arraycopy(offsetsY, offset + length, newOffsetsY,                     offset + views.length,                     oldSize - (offset + length));    offsetsY = newOffsetsY;    // Actually perform the replace.    super.replace(offset, length, views);    // Invalidate layout information.    layoutChanged(X_AXIS);    layoutChanged(Y_AXIS);  }