Methods Summary |
---|
private android.widget.Button | addShort(android.widget.LinearLayout root, java.lang.String label, boolean atBottom)
Button button = new MyButton(this);
button.setText(label);
button.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
0, // height
490));
TextView filler = new TextView(this);
filler.setText("filler");
filler.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
0, // height
510));
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
ll.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
if (atBottom) {
ll.addView(filler);
ll.addView(button);
root.addView(ll);
} else {
ll.addView(button);
ll.addView(filler);
root.addView(ll);
}
return button;
|
public android.widget.LinearLayout | getLayout()
return mLayout;
|
public android.widget.Button | getLeftTall()
return mLeftTall;
|
public android.widget.Button | getMidShort1Top()
return mMidShort1Top;
|
public android.widget.Button | getMidShort2Bottom()
return mMidShort2Bottom;
|
public android.widget.Button | getRightTall()
return mRightTall;
|
private android.widget.Button | makeTall(java.lang.String label)
Button button = new MyButton(this);
button.setText(label);
button.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
return button;
|
protected void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
mLayout = new LinearLayout(this);
mLayout.setOrientation(LinearLayout.HORIZONTAL);
mLayout.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mLeftTall = makeTall("left tall");
mLayout.addView(mLeftTall);
mMidShort1Top = addShort(mLayout, "mid(1) top", false);
mMidShort2Bottom = addShort(mLayout, "mid(2) bottom", true);
mRightTall = makeTall("right tall");
mLayout.addView(mRightTall);
setContentView(mLayout);
|