More on weights in GridLayout

Chance as little as possible from existing. If weights are defined only a
subset of the views in a layout (the normal case) leave the layout of the
remaining views unaffected.

Change-Id: I27473e303c0666930e2fb515b794df96a8b97272
This commit is contained in:
Philip Milne
2014-05-24 21:02:45 -07:00
parent 4885f2f773
commit dea890fa64

View File

@@ -1322,7 +1322,7 @@ public class GridLayout extends ViewGroup {
// we must include views that are GONE here, see introductory javadoc
LayoutParams lp = getLayoutParams(c);
Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
int size = !hasWeights() ?
int size = (spec.weight == 0) ?
getMeasurementIncludingMargin(c, horizontal) :
getOriginalMeasurements()[i] + getDeltas()[i];
groupBounds.getValue(i).include(GridLayout.this, c, spec, this, size);