Example usage for android.widget TableRow setId

List of usage examples for android.widget TableRow setId

Introduction

In this page you can find the example usage for android.widget TableRow setId.

Prototype

public void setId(@IdRes int id) 

Source Link

Document

Sets the identifier for this view.

Usage

From source file:com.bonsai.btcreceive.AccountFragment.java

private void addAddressRow(int tableId, int index, TableLayout table, String path, String addr, String ntrans,
        String btcstr, String fiatstr) {
    TableRow row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.address_table_row, table,
            false);// w w w.ja v a2s. c  om

    row.setTag(tableId);
    row.setId(index);

    row.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            int tableId = (Integer) view.getTag();
            int index = view.getId();
            viewAddress(tableId, index);
        }
    });

    {
        TextView tv = (TextView) row.findViewById(R.id.row_path);
        tv.setText(path);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_addr);
        tv.setText(addr);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_ntrans);
        tv.setText(ntrans);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_btc);
        tv.setText(btcstr);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_fiat);
        tv.setText(fiatstr);
    }

    table.addView(row);
}

From source file:com.bonsai.btcreceive.ViewTransactionActivity.java

private void addTransputsRow(int tableId, int index, TableLayout table, String accountName, String chainCode,
        String path, String addr, String btcstr) {
    TableRow row = (TableRow) LayoutInflater.from(this).inflate(R.layout.transputs_table_row, table, false);

    row.setTag(tableId);/*from  ww w.j a va2  s  .  co m*/
    row.setId(index);

    {
        TextView tv = (TextView) row.findViewById(R.id.row_account);
        tv.setText(accountName);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_chain);
        tv.setText(chainCode);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_path);
        tv.setText(path);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_addr);
        tv.setText(addr);
    }

    {
        TextView tv = (TextView) row.findViewById(R.id.row_btc);
        tv.setText(btcstr);
    }

    table.addView(row);
}

From source file:ru.adios.budgeter.widgets.DataTableLayout.java

private TableRow constructRow(Context context, float weightSum) {
    final TableRow row = new TableRow(context);
    row.setId(ElementsIdProvider.getNextId());
    row.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    row.setWeightSum(weightSum);//from w ww .  j a v  a2s .  c  o  m
    return row;
}

From source file:ru.adios.budgeter.widgets.DataTableLayout.java

/**
 * Requires tableName to be checked, i.e. isPresent() == true .
 *///  w  w w .  ja  va  2 s .c  om
private void addTitleRowWithSeparator(Context context, float layoutWeightSum, float titleViewWeight) {
    final TableRow tableNameRow = new TableRow(context);
    tableNameRow.setId(ElementsIdProvider.getNextId());
    tableNameRow.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    tableNameRow.setWeightSum(1f);

    titleView = Optional
            .of(getCenteredRowText(context, tableName.get(), layoutWeightSum, true, titleViewWeight));
    tableNameRow.addView(titleView.get());
    addView(tableNameRow, 1);
    addView(constructRowSeparator(1), 2);
    headerOffset += 2;
}