private TableRow createTableRow() { TableRow row = new TableRow(getContext()); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); row.setLayoutParams(params); return row; }
private TableRow createTableRow() { TableRow row = new TableRow(getContext()); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); row.setLayoutParams(params); return row; }
@NonNull private TableRow createTableRow() { final TableRow row = new TableRow(getContext()); final ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); row.setLayoutParams(params); return row; }
private TableRow createTableRow() { TableRow row = new TableRow(getContext()); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); row.setLayoutParams(params); return row; }
private TableRow createTableRow() { TableRow row = new TableRow(getContext()); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); row.setLayoutParams(params); return row; }
protected void appendRow( String value ){ // create table row TableLayout tb = (TableLayout)findViewById(R.id.control_table_layout); TableRow tableRow = new TableRow(this); tableRow.setLayoutParams(tableLayout); // get current time long time = System.currentTimeMillis(); SimpleDateFormat dayTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String cur_time = dayTime.format(new Date(time)); // set Text on TextView TextView tv_left = new TextView(this); tv_left.setText( cur_time ); tv_left.setLayoutParams( tableRowLayout ); tableRow.addView( tv_left ); TextView tv_right = new TextView(this); tv_right.setText( value ); tv_right.setLayoutParams( tableRowLayout ); tableRow.addView( tv_right ); // set table rows on table tb.addView(tableRow); }
private void addSeparatorRowToPlayers() { TableRow row = new TableRow(getActivity()); row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); View view = LayoutInflater.from(getActivity()) .inflate(R.layout.box_score_separator, row, false); row.addView(view); playersTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); }
protected TableRow newTempHolder() { TableRow linearLayout_temp = new TableRow(getActivity()); linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, row_height)); return linearLayout_temp; }
private void addTableRow(String id, String key, String val) { TableRow tr = new TableRow(this); MarginLayoutParams params = new ViewGroup.MarginLayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.setMargins(TABLE_ROW_MARGIN, TABLE_ROW_MARGIN, TABLE_ROW_MARGIN, TABLE_ROW_MARGIN); tr.setLayoutParams(params); TextView name = new TextView(this); name.setGravity(Gravity.RIGHT); name.setText(key + ": "); TextView value = new TextView(this); value.setGravity(Gravity.LEFT); value.setText(val); value.setTag(id); tr.addView(name); tr.addView(value); tl.addView(tr, params); }
protected TableRow newTempHolder() { TableRow linearLayout_temp = new TableRow(getActivity()); linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, row_height)); return linearLayout_temp; }
private void addSeparatorRowToStats(int columns) { TableRow row = new TableRow(getActivity()); row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); for (int i = 0; i < columns; i++) { View view = LayoutInflater.from(getActivity()) .inflate(R.layout.box_score_separator, row, false); row.addView(view); } statsTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); }
tblRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT, 1));
protected TableRow newTempHolderBy2() { TableRow linearLayout_temp = new TableRow(getActivity()); linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, calculateRowHeightBy2())); return linearLayout_temp; }
protected TableRow newTempHolderBy2() { TableRow linearLayout_temp = new TableRow(getActivity()); linearLayout_temp.setLayoutParams(new TableRow.LayoutParams(screen_size.x, calculateRowHeightBy2())); return linearLayout_temp; }
private void addDataItem(WOWZDataItem dataItem, TableLayout table, String label) { TableRow row = new TableRow(getActivity()); TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); row.setLayoutParams(rowParams); TextView dataLabel = new TextView(getActivity()); dataLabel.setText(label); dataLabel.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance); dataLabel.setPadding( 15, 15, 15, 15); TableRow.LayoutParams labelParams = new TableRow.LayoutParams(1); labelParams.weight = 1.0f; labelParams.gravity = Gravity.END; dataLabel.setLayoutParams(labelParams); TextView dataValue = new TextView(getActivity()); dataValue.setText(dataItem.toString()); dataValue.setTextAppearance(getActivity(), R.style.DataTableValueAppearance); dataValue.setPadding( 15, 15, 15, 15); TableRow.LayoutParams valueParams = new TableRow.LayoutParams(2); valueParams.weight = 1.0f; dataValue.setLayoutParams(valueParams); row.addView(dataLabel); dataValue.setText(this.shortenVals(dataValue.getText().toString(),8)); row.addView(dataValue); setRowBackground(row); table.addView(row); }
private void addSubSectionFooter(TableLayout table, String label) { TableRow row = new TableRow(getActivity()); TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); row.setLayoutParams(rowParams); TextView dataLabel = new TextView(getActivity()); //dataLabel.setText(label); //dataLabel.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance); dataLabel.setPadding( 15, 15, 15, 15); //TableRow.LayoutParams labelParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); //TableRow.LayoutParams labelParams = new TableRow.LayoutParams(1); //labelParams.weight = 1.0f; //labelParams.gravity = Gravity.END; //dataLabel.setLayoutParams(labelParams); TextView dataValue = new TextView(getActivity()); dataValue.setText("}" + (label != null ? " (" + label + ")" : "")); dataValue.setTextAppearance(getActivity(), R.style.DataTableLabelAppearance); dataValue.setPadding( 15, 15, 15, 15); TableRow.LayoutParams valueParams = new TableRow.LayoutParams(2); valueParams.weight = 1.0f; dataValue.setLayoutParams(valueParams); row.addView(dataLabel); row.addView(dataValue); setRowBackground(row); table.addView(row); }
row.setBackgroundResource(R.color.dataTableSubHeaderBackground); TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); row.setLayoutParams(rowParams);
public void addRowToPlayersTable2(String content) { TableRow row = new TableRow(getActivity()); row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); int width = (int) UnitUtils.convertDpToPixel(100, getActivity()); row.setMinimumWidth(width); if (content.equals("PLAYER")) { TextView tv = addHeaderItem(row, content); tv.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START); row.addView(tv); } else { TextView tv = addNormalItem(row, content); tv.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START); row.addView(tv); } playersTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); }
tableRow.setLayoutParams(tableParams); // TableLayout is the parent view addView(tableRow);
public void displayTeamTotalStats(StatLine statLine){ TableRow row = new TableRow(getActivity()); row.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); row.addView(addNormalItem(row, String.valueOf(statLine.getMin()))); row.addView(addNormalItem(row, String.valueOf(statLine.getPts()))); row.addView(addNormalItem(row, String.valueOf(statLine.getReb()))); row.addView(addNormalItem(row, String.valueOf(statLine.getAst()))); row.addView(addNormalItem(row, String.valueOf(statLine.getStl()))); row.addView(addNormalItem(row, String.valueOf(statLine.getBlk()))); row.addView(addNormalItem(row, String.valueOf(statLine.getBlka()))); row.addView(addNormalItem(row, String.valueOf(statLine.getOreb()))); row.addView(addNormalItem(row, String.valueOf(statLine.getDreb()))); row.addView(addNormalItem(row, String.valueOf(statLine.getFgm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getFga()))); row.addView(addNormalItem(row, getShootingPct(statLine.getFga(), statLine.getFgm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getTpm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getTpa()))); row.addView(addNormalItem(row, getShootingPct(statLine.getTpa(), statLine.getTpm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getFtm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getFta()))); row.addView(addNormalItem(row, getShootingPct(statLine.getFta(), statLine.getFtm()))); row.addView(addNormalItem(row, String.valueOf(statLine.getPf()))); row.addView(addNormalItem(row, String.valueOf(statLine.getTov()))); row.addView(addNormalItem(row, String.valueOf(statLine.getPm()))); statsTable.addView(row, new TableLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)); }