Skip to content

Commit

Permalink
fix: Wrapping in header and view data height (#174)
Browse files Browse the repository at this point in the history
* fix: Wrapping in header and view data height

* fix: chec for image setting

* fix: icon name typo

Co-authored-by: Vittorio Cellucci <[email protected]>
  • Loading branch information
vcellu and vcellu authored Dec 9, 2022
1 parent 7bbe1b6 commit fa361bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public JSONObject toEvent() throws JSONException {
column.put("urlPosition", urlPosition);
column.put("globalMax", globalMax);
column.put("globalMin", globalMin);
column.put("imageSetting", imageSetting);
if(miniChart != null) {
column.put("miniChart", miniChart.toEvent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected void updateScrollbarBounds() {
}

protected void updateRowHeights() {
tableView.cellContentStyle.themedRowHeight = (tableView.cellContentStyle.getLineHeight() * tableView.cellContentStyle.lineCount) + CellView.PADDING_X_2;
tableView.cellContentStyle.themedRowHeight = tableView.cellContentStyle.getLineHeight() + CellView.PADDING_X_2;
tableView.rowHeight = tableView.cellContentStyle.themedRowHeight;
tableView.headerHeight = tableView.headerContentStyle.getLineHeight() + CellView.PADDING_X_2;
tableView.totalsHeight = tableView.cellContentStyle.getLineHeight() + CellView.PADDING_X_2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void measureLineCountNoUpdate() {
}

protected int calculateLineCount() {
int width = Math.max(column.width - textView.getPaddingRight() - textView.getPaddingLeft(), 0);
int width = Math.max(column.width - textView.getPaddingRight() - textView.getPaddingLeft() - additionalPadding, 0);
measureTextPaint.setTypeface(textView.getTypeface());
StaticLayout.Builder builder = StaticLayout.Builder.obtain(textView.getText(), 0, textView.getText().length(), measureTextPaint, width);
builder.setIncludePad(true);
Expand Down
5 changes: 4 additions & 1 deletion src/components/ImageCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ export type ImageCellProps = {

const ImageCell: React.FC<ImageCellProps> = ({ rowData, colData, style }) => {
const imageUrl = useMemo(() => {
if(colData?.representation?.imageSetting === 'label') {
return rowData.qText;
}
const imageIndex = colData?.stylingInfo?.indexOf('imageUrl');
if (imageIndex !== -1 && rowData.qAttrExps) {
return rowData.qAttrExps.qValues[imageIndex].qText;
}
return undefined;
return rowData.qText;
}, [colData, rowData]);
return (
<View style={style}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const iconMap = new Map([
['Q', 'remove'],
['è', 'warning'],
['¢', 'clean-hands'],
['©', 'lag'],
['©', 'flag'],
['23F4', 'lightbulb'],
['2013', 'stop'],
['&', 'pie-chart'],
Expand Down

0 comments on commit fa361bc

Please sign in to comment.