summaryrefslogtreecommitdiff
path: root/tests/GridLayoutTest/src
diff options
context:
space:
mode:
authorPhilip Milne <pmilne@google.com>2011-08-05 11:04:36 -0700
committerPhilip Milne <pmilne@google.com>2011-08-05 11:24:55 -0700
commitb559976a50c34848d602cc7138859507a379893c (patch)
tree56da177ef94736006ca1141cb8e0f22394a85d35 /tests/GridLayoutTest/src
parentb491877331cab95b8d2f9191a674476f826f92a5 (diff)
Remove call to setPadding() in setUseDefaultMargins().
It is not possible for teh user to override the assigned padding values because the XML attributes are processed in the opposite order. Also, make the XML and Java examples grid3.xml and Activity2.java consistent in preparation for a move to API demos. Change-Id: I47334f9f5a46a8a528067d88350dd70eaa38ff33
Diffstat (limited to 'tests/GridLayoutTest/src')
-rw-r--r--tests/GridLayoutTest/src/com/android/test/layout/Activity2.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java
index 907ee9cadc9a..8974f374efeb 100644
--- a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java
+++ b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java
@@ -38,7 +38,6 @@ public class Activity2 extends Activity {
p.setUseDefaultMargins(true);
p.setAlignmentMode(ALIGN_BOUNDS);
p.setRowOrderPreserved(false);
- p.setPadding(0, 0, 0, 0);
Spec row1 = spec(0);
Spec row2 = spec(1);
@@ -75,12 +74,9 @@ public class Activity2 extends Activity {
}
{
EditText c = new EditText(context);
+ c.setEms(10);
c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
- {
- LayoutParams lp = new LayoutParams(row3, col2);
- lp.width = (int) c.getPaint().measureText("Frederick.W.Flintstone");
- p.addView(c, lp);
- }
+ p.addView(c, new LayoutParams(row3, col2));
}
{
TextView c = new TextView(context);
@@ -89,17 +85,13 @@ public class Activity2 extends Activity {
}
{
TextView c = new EditText(context);
+ c.setEms(8);
c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
- {
- LayoutParams lp = new LayoutParams(row4, col2);
- lp.width = (int) c.getPaint().measureText("************");
- p.addView(c, lp);
- }
+ p.addView(c, new LayoutParams(row4, col2));
}
{
Space c = new Space(context);
LayoutParams lp = new LayoutParams(row5, col3);
- lp.setMargins(0, 0, 0, 0);
p.addView(c, lp);
}
{