FileDocCategorySizeDatePackage
TableLayout7.javaAPI DocGoogle Android v1.5 Example2681Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.view

TableLayout7

public class TableLayout7 extends android.app.Activity

Fields Summary
private boolean
mShortcutsCollapsed
private boolean
mCheckmarksCollapsed
Constructors Summary
Methods Summary
private voidappendRow(android.widget.TableLayout table)

        TableRow row = new TableRow(this);

        TextView label = new TextView(this);
        label.setText(R.string.table_layout_7_quit);
        label.setPadding(3, 3, 3, 3);

        TextView shortcut = new TextView(this);
        shortcut.setText(R.string.table_layout_7_ctrlq);
        shortcut.setPadding(3, 3, 3, 3);
        shortcut.setAlignment(Layout.Alignment.ALIGN_OPPOSITE);

        row.addView(label, new TableRow.LayoutParams(1));
        row.addView(shortcut, new TableRow.LayoutParams());

        table.addView(row, new TableLayout.LayoutParams());
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.table_layout_7);

        final TableLayout table = (TableLayout) findViewById(R.id.menu);
        Button button = (Button) findViewById(R.id.toggle1);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                mShortcutsCollapsed = !mShortcutsCollapsed;
                table.setColumnCollapsed(2, mShortcutsCollapsed);
            }
        });
        button = (Button) findViewById(R.id.toggle2);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                mCheckmarksCollapsed = !mCheckmarksCollapsed;
                table.setColumnCollapsed(0, mCheckmarksCollapsed);
            }
        });

        mCheckmarksCollapsed = table.isColumnCollapsed(0);
        mShortcutsCollapsed = table.isColumnCollapsed(2);

        appendRow(table);