From b971a1d8785e48ef31610bcec4610e9ac0483149 Mon Sep 17 00:00:00 2001 From: Vittorio Cellucci Date: Fri, 9 Dec 2022 12:53:01 -0500 Subject: [PATCH] fix: Wrapping in header and view data height --- .../com/qliktrialreactnativestraighttable/TableViewFactory.java | 2 +- .../java/com/qliktrialreactnativestraighttable/TextWrapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/qliktrialreactnativestraighttable/TableViewFactory.java b/android/src/main/java/com/qliktrialreactnativestraighttable/TableViewFactory.java index b1f8d938..d11a9ad8 100644 --- a/android/src/main/java/com/qliktrialreactnativestraighttable/TableViewFactory.java +++ b/android/src/main/java/com/qliktrialreactnativestraighttable/TableViewFactory.java @@ -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; diff --git a/android/src/main/java/com/qliktrialreactnativestraighttable/TextWrapper.java b/android/src/main/java/com/qliktrialreactnativestraighttable/TextWrapper.java index 18dcc2bb..57a83cb5 100644 --- a/android/src/main/java/com/qliktrialreactnativestraighttable/TextWrapper.java +++ b/android/src/main/java/com/qliktrialreactnativestraighttable/TextWrapper.java @@ -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);