adaptive table layout csv file issue
sanduni opened this issue · 1 comments
sanduni commented
how to pass custom object array list without using csv file? how to update particular cell?
PolarRoot commented
Good day @sanduni! Thx for using our library.
You can use custom array list by this way:
Open library sample, open CsvFileDataSourceImpl and modify getRow method like this:
List getRow(int rowIndex) {
ArrayList<ArrayList<String>> data = new ArrayList<>();
ArrayList<String> tableHeader = new ArrayList<>();
tableHeader.add("N");
tableHeader.add("1");
tableHeader.add("2");
tableHeader.add("3");
tableHeader.add("4");
ArrayList<String> firstRow = new ArrayList<>();
firstRow.add("1");
firstRow.add("value 1");
firstRow.add("value 2");
firstRow.add("value 3");
firstRow.add("value 4");
ArrayList<String> secondRow = new ArrayList<>();
secondRow.add("2");
secondRow.add("value 1");
secondRow.add("value 2");
secondRow.add("value 3");
secondRow.add("value 4");
data.add(tableHeader);
data.add(firstRow);
data.add(secondRow);
return data.get(rowIndex);
}
if you don't need to show empty cells, in method init() change value of mRowsCount to value of quantity of you rows: mRowsCount = data.size(); (for example)
With best regards Cleveroad team.