From 859cc32d8150ea933a703c3ba31c659a52c8b29e Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 19 May 2021 17:54:55 +0200 Subject: [PATCH] Allow same-line message footer even if text RTL != locale RTL if space Change-Id: I54683129c651697dd831ed832fe8cc45d668cb14 --- .../java/im/vector/app/core/ui/views/FooteredTextView.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/ui/views/FooteredTextView.kt b/vector/src/main/java/im/vector/app/core/ui/views/FooteredTextView.kt index 8760bb6ff6..11d7877320 100644 --- a/vector/src/main/java/im/vector/app/core/ui/views/FooteredTextView.kt +++ b/vector/src/main/java/im/vector/app/core/ui/views/FooteredTextView.kt @@ -50,11 +50,6 @@ class FooteredTextView @JvmOverloads constructor( val viewIsRtl = layoutDirection == LAYOUT_DIRECTION_RTL val lastVisibleCharacter = layout.getLineVisibleEnd(lastLine) - 1 val looksLikeRtl = layout.isRtlCharAt(lastVisibleCharacter) - if (looksLikeRtl != viewIsRtl) { - // Our footer would overlap text even if there is space in the last line, so reserve space in y-direction - setMeasuredDimension(max(measuredWidth, footerWidth), measuredHeight + footerHeight) - return - } // Get required width for all lines var maxLineWidth = 0f @@ -70,7 +65,7 @@ class FooteredTextView @JvmOverloads constructor( val widthLastLine = layout.getLineWidth(lastLine) // Required width if putting footer in the same line as the last line - val widthWithHorizontalFooter = widthLastLine + footerWidth + val widthWithHorizontalFooter = (if (looksLikeRtl == viewIsRtl) widthLastLine else maxLineWidth) + footerWidth // Is there space for a horizontal footer? if (widthWithHorizontalFooter <= widthLimit) {