updateChildRequirements(axis); updateRequirements(axis);
long sumPref = 0; int n = getViewCount(); for (int i = 0; i < n; i++) { View child = getView(i); spans[i] = (int) child.getPreferredSpan(axis); sumPref = spans[i]; }
  protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,                                 int[] spans)  {    updateChildRequirements(axis);    updateRequirements(axis);    // Calculate the spans and offsets using the SizeRequirements uility    // methods.    SizeRequirements.calculateTiledPositions(targetSpan, requirements[axis],                                             childReqs[axis],                                             offsets, spans);  }