SortableTableView icon indicating copy to clipboard operation
SortableTableView copied to clipboard

Content of cells not wrapping to next line

Open iampapagray opened this issue 6 years ago • 4 comments

Hello,

I am using the latest version of this library and very grateful for its existence. I need help. After adding my data to the table, the content are rather truncated and the end replaced with ellipses instead of wrapping to the next line. Same for the headers.

Any Help???

iampapagray avatar Apr 29 '18 22:04 iampapagray

Hi @iampapagray,

the described behaviour is the expected behaviour of the SimpleTableHeaderAdapter and SimpleTableDataAdapter. If you want to have another behaviour you should implement a custom Adapter.

Best regards, Ingo

ISchwarz23 avatar Apr 30 '18 06:04 ISchwarz23

Thanks but i am quite new to android programming... Can you point me in a direction

iampapagray avatar Apr 30 '18 11:04 iampapagray

I am trying this that i found

public class WrapTextTableAdapter extends SimpleTableDataAdapter {

public SimpleTableDataAdapter(final Context context, final String[][] data) {
    super(context, data);
}

public SimpleTableDataAdapter(final Context context, final List<String[]> data) {
    super(context, data);
}

@Override public View getCellView(final int rowIndex, final int columnIndex, final ViewGroup parentView) { TextView textView = (TextView) super.getCellView(rowIndex, columnIndex, parentView); textView.setSingleLine(false); textView.setEllipsize(0); ... return textView; }

}

But i get an error that "cannot inherit from final 'de.codecrafters.tableview.toolkit.SimpleTableDataAdapter' "

iampapagray avatar Apr 30 '18 11:04 iampapagray

Hi @iampapagray,

you should inherit from the TableDataAdapter. If you want to show string arrays in your table rows extend from TableDataAdapter<String[]>. And then copy paste the code of the SimpleTableDataAdapter.

Best regards, Ingo

ISchwarz23 avatar May 01 '18 17:05 ISchwarz23