diff options
author | Philip Milne <pmilne@google.com> | 2011-07-21 11:39:37 -0700 |
---|---|---|
committer | Philip Milne <pmilne@google.com> | 2011-07-25 12:12:10 -0700 |
commit | 5125e21bc0bbe5b9718d0f03b26cdafc67a7c726 (patch) | |
tree | 69107cc13318d24598a4e143d0359e8d4809c1ff /tests/GridLayoutTest/src | |
parent | e432a0005180ba9ac2c1d7822c4761b475fddc51 (diff) | |
download | frameworks_base-5125e21bc0bbe5b9718d0f03b26cdafc67a7c726.zip frameworks_base-5125e21bc0bbe5b9718d0f03b26cdafc67a7c726.tar.gz frameworks_base-5125e21bc0bbe5b9718d0f03b26cdafc67a7c726.tar.bz2 |
Fix for http://b/issue?id=5064532
5064532: GridLayout with initial "stretchy" row and "gone" view in last row doesn't stretch properly
Also:
. Infer stretchibility from whether or not gravity is defined.
. Make algorithms for handling flexibility within cell groups consistent
with those acting between cells groups (via constraint system).
. Hide and deprecate methods taking flexibility argument.
. Hide and deprecate CAN_STRETCH constant.
Both deprecated features will be removed after references are removed from platform.
Change-Id: Iabf2bf19f35cf30b8ec49c99b49a0550fd495125
Diffstat (limited to 'tests/GridLayoutTest/src')
-rw-r--r-- | tests/GridLayoutTest/src/com/android/test/layout/Activity2.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java index 38a85a3..e1871ac 100644 --- a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java +++ b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java @@ -38,30 +38,31 @@ public class Activity2 extends Activity { vg.setUseDefaultMargins(true); vg.setAlignmentMode(ALIGN_BOUNDS); - Spec row1 = spec(0, CENTER); - Spec row2 = spec(1, CENTER); + Spec row1 = spec(0); + Spec row2 = spec(1); Spec row3 = spec(2, BASELINE); Spec row4 = spec(3, BASELINE); - Spec row5 = spec(4, FILL, CAN_STRETCH); - Spec row6 = spec(5, CENTER); - Spec row7 = spec(6, CENTER); + Spec row5 = spec(4, FILL); + Spec row6 = spec(5); + Spec row7 = spec(6); Spec col1a = spec(0, 4, CENTER); Spec col1b = spec(0, 4, LEFT); Spec col1c = spec(0, RIGHT); Spec col2 = spec(1, LEFT); - Spec col3 = spec(2, FILL, CAN_STRETCH); - Spec col4 = spec(3, FILL); + Spec col3 = spec(2, FILL); + Spec col4a = spec(3); + Spec col4b = spec(3, FILL); { TextView v = new TextView(context); - v.setTextSize(48); + v.setTextSize(32); v.setText("Email setup"); vg.addView(v, new LayoutParams(row1, col1a)); } { TextView v = new TextView(context); - v.setTextSize(20); + v.setTextSize(16); v.setText("You can configure email in just a few steps:"); vg.addView(v, new LayoutParams(row2, col1b)); } @@ -75,7 +76,7 @@ public class Activity2 extends Activity { v.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS); { LayoutParams lp = new LayoutParams(row3, col2); - lp.width = (int) v.getPaint().measureText("Frederick.W.Flintstone@bedrock.com "); + lp.width = (int) v.getPaint().measureText("Frederick.W.Flintstone"); vg.addView(v, lp); } } @@ -95,17 +96,19 @@ public class Activity2 extends Activity { } { Space v = new Space(context); - vg.addView(v, new LayoutParams(row5, col3)); + LayoutParams lp = new LayoutParams(row5, col3); + lp.setMargins(0, 0, 0, 0); + vg.addView(v, lp); } { Button v = new Button(context); v.setText("Manual setup"); - vg.addView(v, new LayoutParams(row6, col4)); + vg.addView(v, new LayoutParams(row6, col4a)); } { Button v = new Button(context); v.setText("Next"); - vg.addView(v, new LayoutParams(row7, col4)); + vg.addView(v, new LayoutParams(row7, col4b)); } return vg; |