From 4885f2f773915a48d0e2f67bc604b081327372a0 Mon Sep 17 00:00:00 2001 From: Philip Milne Date: Fri, 23 May 2014 23:12:11 -0700 Subject: [PATCH] More on adding support for weights to GridLayout Remove fields that are not needed with view-based allocation. Change-Id: I23dc75fea47c532ad46e23b7fb14ff8e46c68db1 --- core/java/android/widget/GridLayout.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java index e90f0ee9ef289..df27f86a50967 100644 --- a/core/java/android/widget/GridLayout.java +++ b/core/java/android/widget/GridLayout.java @@ -2349,8 +2349,6 @@ public class GridLayout extends ViewGroup { public int before; public int after; public int flexibility; // we're flexible iff all included specs are flexible - public float weight; // the min of the weights of the individual specs - public int shareOfDelta; private Bounds() { reset(); @@ -2360,7 +2358,6 @@ public class GridLayout extends ViewGroup { before = Integer.MIN_VALUE; after = Integer.MIN_VALUE; flexibility = CAN_STRETCH; // from the above, we're flexible when empty - weight = Float.MAX_VALUE; // default is large => row/cols take all slack when empty } protected void include(int before, int after) { @@ -2374,7 +2371,7 @@ public class GridLayout extends ViewGroup { return MAX_SIZE; } } - return before + after + shareOfDelta; + return before + after; } protected int getOffset(GridLayout gl, View c, Alignment a, int size, boolean horizontal) { @@ -2383,7 +2380,6 @@ public class GridLayout extends ViewGroup { protected final void include(GridLayout gl, View c, Spec spec, Axis axis, int size) { this.flexibility &= spec.getFlexibility(); - weight = Math.min(weight, spec.weight); boolean horizontal = axis.horizontal; Alignment alignment = gl.getAlignment(spec.alignment, horizontal); // todo test this works correctly when the returned value is UNDEFINED