Search in sources :

Example 1 with LayoutParams

use of android.widget.TableRow.LayoutParams in project android-nfc-paycardreader by rayyan.

the class ECCardInfosActivity method addAIDRow.

private void addAIDRow(CharSequence left, CharSequence right) {
    TextView t1 = new TextView(this);
    t1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    t1.setPadding(0, 0, (int) (getResources().getDisplayMetrics().density * 10 + 0.5f), 0);
    t1.setTextAppearance(this, android.R.attr.textAppearanceMedium);
    t1.setText(left);
    TextView t2 = new TextView(this);
    t2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    t2.setText(right);
    TableRow tr = new TableRow(this);
    tr.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    tr.addView(t1);
    tr.addView(t2);
    TableLayout t = (TableLayout) findViewById(R.id.table_features);
    t.addView(tr, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
}
Also used : LayoutParams(android.widget.TableRow.LayoutParams) TableRow(android.widget.TableRow) TextView(android.widget.TextView) TableLayout(android.widget.TableLayout)

Aggregations

TableLayout (android.widget.TableLayout)1 TableRow (android.widget.TableRow)1 LayoutParams (android.widget.TableRow.LayoutParams)1 TextView (android.widget.TextView)1