diff options
Diffstat (limited to 'tests/GridLayoutTest/src/com/android/test/layout/Activity2.java')
-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; |