Skip to content

Commit 3e35030

Browse files
Philip MilneAndroid (Google) Code Review
authored andcommitted
Merge "Fix for layout parameter validation bug in GridLayout." into jb-dev
2 parents 61552bc + 8a36e05 commit 3e35030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/widget/GridLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ private static int clip(Interval minorRange, boolean minorWasDefined, int count)
658658
private void validateLayoutParams() {
659659
final boolean horizontal = (orientation == HORIZONTAL);
660660
final Axis axis = horizontal ? horizontalAxis : verticalAxis;
661-
final int count = (axis.definedCount != UNDEFINED) ? axis.definedCount : 0;
661+
final int count = max(0, axis.getCount()); // Handle negative values, including UNDEFINED
662662

663663
int major = 0;
664664
int minor = 0;

0 commit comments

Comments
 (0)