use of android.widget.TableLayout in project android_frameworks_base by crdroidandroid.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
use of android.widget.TableLayout in project android_frameworks_base by AOSPA.
the class AddColumn method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.add_column_in_table);
final Button addRowButton = (Button) findViewById(R.id.add_row_button);
addRowButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final TableLayout table = (TableLayout) findViewById(R.id.table);
final TableRow newRow = new TableRow(AddColumn.this);
for (int i = 0; i < 4; i++) {
final TextView view = new TextView(AddColumn.this);
view.setText("Column " + (i + 1));
view.setPadding(3, 3, 3, 3);
newRow.addView(view, new TableRow.LayoutParams());
}
table.addView(newRow, new TableLayout.LayoutParams());
newRow.requestLayout();
}
});
}
use of android.widget.TableLayout in project drmips by brunonova.
the class DlgCodeHelp method setContents.
private void setContents(View rootView) {
DrMIPSActivity activity = (DrMIPSActivity) getActivity();
TableLayout tblInstructions = (TableLayout) rootView.findViewById(R.id.tblInstructions);
TableLayout tblPseudos = (TableLayout) rootView.findViewById(R.id.tblPseudos);
TableRow row;
TextView inst, desc;
tblInstructions.removeAllViews();
tblPseudos.removeAllViews();
CPU cpu = activity.getCPU();
for (Instruction i : cpu.getInstructionSet().getInstructions()) {
row = new TableRow(activity);
inst = new TextView(activity);
inst.setText(i.getUsage() + " ");
row.addView(inst);
desc = new TextView(activity);
desc.setText("# " + (i.hasDescription() ? i.getDescription() : "-"));
row.addView(desc);
tblInstructions.addView(row);
}
for (PseudoInstruction i : cpu.getInstructionSet().getPseudoInstructions()) {
row = new TableRow(activity);
inst = new TextView(activity);
inst.setText(i.getUsage() + " ");
row.addView(inst);
desc = new TextView(activity);
desc.setText("# " + (i.hasDescription() ? i.getDescription() : "-"));
row.addView(desc);
tblPseudos.addView(row);
}
}
Aggregations