diff options
author | Philip Milne <pmilne@google.com> | 2011-07-14 11:32:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-14 11:32:09 -0700 |
commit | d44264a5eebbecc5ae02f9036d61b888d494e133 (patch) | |
tree | 0fe4d6dbc56afa90e919fb58306385130a4dc423 /tests | |
parent | d1435e998b938e2d85b5ed24d83f3521452aaf81 (diff) | |
parent | 93cd6a6c78683643de51f9e698b38847bd1f1155 (diff) | |
download | frameworks_base-d44264a5eebbecc5ae02f9036d61b888d494e133.zip frameworks_base-d44264a5eebbecc5ae02f9036d61b888d494e133.tar.gz frameworks_base-d44264a5eebbecc5ae02f9036d61b888d494e133.tar.bz2 |
Merge "Rationalize API after adding maximum size feature."
Diffstat (limited to 'tests')
3 files changed, 18 insertions, 24 deletions
diff --git a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java index b9bf526..af5006f 100644 --- a/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java +++ b/tests/GridLayoutTest/src/com/android/test/layout/Activity2.java @@ -38,20 +38,20 @@ public class Activity2 extends Activity { vg.setUseDefaultMargins(true); vg.setAlignmentMode(ALIGN_BOUNDS); - Group row1 = new Group(1, CENTER); - Group row2 = new Group(2, CENTER); - Group row3 = new Group(3, BASELINE); - Group row4 = new Group(4, BASELINE); - Group row5 = new Group(5, FILL); - Group row6 = new Group(6, CENTER); - Group row7 = new Group(7, CENTER); + Spec row1 = spec(0, CENTER); + Spec row2 = spec(1, CENTER); + 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); - Group col1a = new Group(1, 4, CENTER); - Group col1b = new Group(1, 4, LEFT); - Group col1c = new Group(1, RIGHT); - Group col2 = new Group(2, LEFT); - Group col3 = new Group(3, FILL); - Group col4 = new Group(4, FILL); + 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); { TextView v = new TextView(context); @@ -96,10 +96,7 @@ public class Activity2 extends Activity { { Space v = new Space(context); { - LayoutParams lp = new LayoutParams(row5, col3); - lp.columnGroup.flexibility = CAN_STRETCH; - lp.rowGroup.flexibility = CAN_STRETCH; - vg.addView(v, lp); + vg.addView(v, new LayoutParams(row5, col3)); } } { diff --git a/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java b/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java index 505c83d..b1c4486 100755 --- a/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java +++ b/tests/GridLayoutTest/src/com/android/test/layout/AlignmentTest.java @@ -21,7 +21,6 @@ import android.content.Context; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; -import android.view.ViewParent; import android.widget.Button; import android.widget.EditText; import android.widget.GridLayout; @@ -84,9 +83,7 @@ public class AlignmentTest extends Activity { Alignment va = VERTICAL_ALIGNMENTS[i]; for (int j = 0; j < HORIZONTAL_ALIGNMENTS.length; j++) { Alignment ha = HORIZONTAL_ALIGNMENTS[j]; - Group rowGroup = new Group(i, va); - Group colGroup = new Group(j, ha); - LayoutParams layoutParams = new LayoutParams(rowGroup, colGroup); + LayoutParams layoutParams = new LayoutParams(spec(i, va), spec(j, ha)); String name = VERTICAL_NAMES[i] + "-" + HORIZONTAL_NAMES[j]; ViewFactory factory = FACTORIES[(i + j) % FACTORIES.length]; container.addView(factory.create(name, 20), layoutParams); diff --git a/tests/GridLayoutTest/src/com/android/test/layout/GridLayoutTest.java b/tests/GridLayoutTest/src/com/android/test/layout/GridLayoutTest.java index c5681e2..4ce449a 100644 --- a/tests/GridLayoutTest/src/com/android/test/layout/GridLayoutTest.java +++ b/tests/GridLayoutTest/src/com/android/test/layout/GridLayoutTest.java @@ -33,9 +33,9 @@ public class GridLayoutTest extends AbstractLayoutTest { int va = VERTICAL_ALIGNMENTS[i]; for (int j = 0; j < HORIZONTAL_ALIGNMENTS.length; j++) { int ha = HORIZONTAL_ALIGNMENTS[j]; - GridLayout.Group rowGroup = new GridLayout.Group(UNDEFINED, null); - GridLayout.Group colGroup = new GridLayout.Group(UNDEFINED, null); - GridLayout.LayoutParams lp = new GridLayout.LayoutParams(rowGroup, colGroup); + Spec rowSpec = spec(UNDEFINED, null); + Spec colSpec = spec(UNDEFINED, null); + GridLayout.LayoutParams lp = new GridLayout.LayoutParams(rowSpec, colSpec); //GridLayout.LayoutParams lp = new GridLayout.LayoutParams(); lp.setGravity(va | ha); View v = create(context, VERTICAL_NAMES[i] + "-" + HORIZONTAL_NAMES[j], 20); |