diff options
| author | Philip Milne <pmilne@google.com> | 2013-04-22 12:44:29 -0700 |
|---|---|---|
| committer | Philip Milne <pmilne@google.com> | 2013-04-22 12:58:55 -0700 |
| commit | ca2e9e1122ba8b83d05bd144d0be31e8a3c30537 (patch) | |
| tree | 400c9b1e25221b48edeafed040b4a4d50dbdc616 /core/java/android/widget | |
| parent | 5d1a182a8a2dd9613ef3b1f2de7b6a3d690ae890 (diff) | |
Fix for bug 8578258: GridLayout is forcing wrong width to TextView widgets
GridLayout is working as intended here. The bug is appears to be in RelativeLayout
(and possibly LinearLayout).
The value of RelativeLayout.DEFAULT_WIDTH = Integer.MAX_VALUE/2 is 0x3FFFFFFF has bits
set in the range that is used to flag certain conditions and states by the layout system.
In View we have:
MEASURED_SIZE_MASK = 0x00ffffff
MEASURED_STATE_MASK = 0xff000000;
MEASURED_STATE_TOO_SMALL = 0x01000000
This change fixes this bug, though it looks as if that a safer solution would be to not introduce
this constant and code path in the first place - as RelativeLayout's measurement algorithm operates
in the LTR case without it.
Change-Id: I01c51ae854620f08dd63047594486a3464c86f3a
Diffstat (limited to 'core/java/android/widget')
| -rw-r--r-- | core/java/android/widget/RelativeLayout.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index 3df7258ba44c..906f02dc4a1f 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -226,7 +226,12 @@ public class RelativeLayout extends ViewGroup { private boolean mMeasureVerticalWithPaddingMargin = false; // A default width used for RTL measure pass - private static final int DEFAULT_WIDTH = Integer.MAX_VALUE / 2; + /** + * Value reduced so as not to interfere with View's measurement spec. flags. See: + * {@link View#MEASURED_SIZE_MASK}. + * {@link View#MEASURED_STATE_TOO_SMALL}. + **/ + private static final int DEFAULT_WIDTH = 0x008000000; public RelativeLayout(Context context) { super(context); |
