summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorPhilip Milne <pmilne@google.com>2013-02-12 14:29:17 -0800
committerPhilip Milne <pmilne@google.com>2013-02-12 14:29:17 -0800
commite5e0b7f191b64380e9231a2b755ecd3738598dec (patch)
tree4c556d83123de995b9ad8aa13d69116c99ef69f1 /core/java
parent145716e7c15867b13f518e49d3611a5f8030e7ee (diff)
downloadframeworks_base-e5e0b7f191b64380e9231a2b755ecd3738598dec.zip
frameworks_base-e5e0b7f191b64380e9231a2b755ecd3738598dec.tar.gz
frameworks_base-e5e0b7f191b64380e9231a2b755ecd3738598dec.tar.bz2
Fix for bug: 8184401 - GridLayout accounts for child's size/measurements even when a child is "GONE"
Added a check for GONE status in measurement calculations. Change-Id: I3ec82b03f3089730f10dbd6916f6245188cd8452
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/GridLayout.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 85ed8db..12cce8b 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -1235,6 +1235,7 @@ public class GridLayout extends ViewGroup {
Assoc<Spec, Bounds> assoc = Assoc.of(Spec.class, Bounds.class);
for (int i = 0, N = getChildCount(); i < N; i++) {
View c = getChildAt(i);
+ if (c.getVisibility() == View.GONE) continue;
LayoutParams lp = getLayoutParams(c);
Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
Bounds bounds = getAlignment(spec.alignment, horizontal).getBounds();
@@ -1250,6 +1251,7 @@ public class GridLayout extends ViewGroup {
}
for (int i = 0, N = getChildCount(); i < N; i++) {
View c = getChildAt(i);
+ if (c.getVisibility() == View.GONE) continue;
LayoutParams lp = getLayoutParams(c);
Spec spec = horizontal ? lp.columnSpec : lp.rowSpec;
groupBounds.getValue(i).include(GridLayout.this, c, spec, this);