Search in sources :

Example 11 with TableLayout

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();
        }
    });
}
Also used : Button(android.widget.Button) TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TableLayout(android.widget.TableLayout)

Example 12 with TableLayout

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();
        }
    });
}
Also used : Button(android.widget.Button) TableRow(android.widget.TableRow) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TableLayout(android.widget.TableLayout)

Example 13 with TableLayout

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);
    }
}
Also used : PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction) TableRow(android.widget.TableRow) CPU(brunonova.drmips.simulator.CPU) TextView(android.widget.TextView) PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction) Instruction(brunonova.drmips.simulator.Instruction) DrMIPSActivity(brunonova.drmips.android.DrMIPSActivity) TableLayout(android.widget.TableLayout)

Aggregations

TableLayout (android.widget.TableLayout)13 TableRow (android.widget.TableRow)13 TextView (android.widget.TextView)13 View (android.view.View)9 Button (android.widget.Button)7 Context (android.content.Context)2 DrMIPSActivity (brunonova.drmips.android.DrMIPSActivity)2 SuppressLint (android.annotation.SuppressLint)1 Bitmap (android.graphics.Bitmap)1 Bundle (android.os.Bundle)1 ViewGroup (android.view.ViewGroup)1 Window (android.view.Window)1 RotateAnimation (android.view.animation.RotateAnimation)1 ImageButton (android.widget.ImageButton)1 ImageView (android.widget.ImageView)1 ScrollView (android.widget.ScrollView)1 LayoutParams (android.widget.TableRow.LayoutParams)1 CPU (brunonova.drmips.simulator.CPU)1 Instruction (brunonova.drmips.simulator.Instruction)1 PseudoInstruction (brunonova.drmips.simulator.PseudoInstruction)1