-1

I have a class Selfportrait with 2 String[] or ArrayList (Strengths and Weaknesses) and each with different amount of data. I need to fill the table. Here is the picture example:

I can make a table with ListView with 2 TextView objects, fill them in pairs and if there is no pairs left, just fill one TextView object. But it is too inconvenient. Is there a way to do this more efficiently?

Here is the Selfportrait.class:

public class Selfportrait {

private List<String> strengths;
private List<String> weaknesses;

private String uniqueId;

public Selfportrait(ArrayList<String> strengths, ArrayList<String> weaknesses) {
    this.strengths = strengths;
    this.weaknesses = weaknesses;
    uniqueId = UUID.randomUUID().toString();
}

1 Answers1

1

Use Recycler view with grid layout manager. It was designed to make grids. Post your code if you want a more detailed answer

Suhaib Roomy
  • 2,501
  • 1
  • 16
  • 22
  • i've added my class code, which needs to be written into the table/grid – yungbroccoli May 21 '18 at 17:12
  • Could you please give more detailed answer it seems like there is no example for exactly this kind of functionality, when user can add strings per column... – yungbroccoli May 21 '18 at 20:27
  • if the length of data2 is longer than data1, you want column one to remain empty and column to get filled right? PS - I am a bit buzy right now will post some code in some time – Suhaib Roomy May 22 '18 at 09:20
  • Well yeah. Basically i want to fill data by Columns and not by Rows. For Example, add Row/Data to a Column1, then add one more Row/Data to Column1, while Column2 remains empty, as long as i don't add any Row/Data to it. Yea, sure. Thanks! – yungbroccoli May 22 '18 at 09:31