This is referenced Image of what I want, But im unable to do it, currently im using tablelayout, what i should do? Ofcourse my total requirement are vertical and horizontal scrolling.
My current code is below with this I cant even have row of diff width, same width get applied to all below rows of column
/* create cell element - button */
for (int i = 0; i < 14; i++) {
if (i == 0) {
TableRow.LayoutParams tableRowParams = new TableRow.LayoutParams(
100,
100);
// tableRowParams.column=1;
// tableRowParams.span=2;
TableRow tableRow = new TableRow(this);
View v = LayoutInflater.from(this).inflate(R.layout.item_header, tableRow, false);
tableRow.setLayoutParams(tableRowParams);
TextView tv_label = (TextView)v.findViewById(R.id.tv_label);
LinearLayout ll_row = (LinearLayout)v.findViewById(R.id.ll_row);
tv_label.setText("dynamic " + i);
ll_row.setBackgroundColor(Color.parseColor("#6ab04c"));
// ll_row.getLayoutParams().height = 100;
// ll_row.getLayoutParams().width = 400;
// ll_row.requestLayout();
tableRow.addView(v);
tableLayout.addView(tableRow);
} else {
TableRow.LayoutParams tableRowParams = new TableRow.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
// tableRowParams.column=1;
// tableRowParams.span=1;
TableRow tableRow = new TableRow(this);
View v = LayoutInflater.from(this).inflate(R.layout.item_header, tableRow, false);
tableRow.setLayoutParams(tableRowParams);
TextView tv_label = (TextView)v.findViewById(R.id.tv_label);
LinearLayout ll_row = (LinearLayout)v.findViewById(R.id.ll_row);
tv_label.setText("dynamic " + i);
ll_row.setBackgroundColor(Color.parseColor("#6ab04c"));
// ll_row.getLayoutParams().height = 300;
// ll_row.getLayoutParams().width = 200;
// ll_row.requestLayout();
tableRow.addView(v);
tableLayout.addView(tableRow);
}
}
My current Output is this: My Current Output