Minor tweaks

This commit is contained in:
Niels Andriesse 2021-06-21 13:43:49 +10:00
parent 6d9eb0a932
commit 6ddde26496
2 changed files with 8 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.conversation.v2.messages
import android.content.Context import android.content.Context
import android.content.res.Resources import android.content.res.Resources
import android.util.AttributeSet import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.RelativeLayout import android.widget.RelativeLayout
@ -59,9 +60,12 @@ class QuoteView : LinearLayout {
fun getIntrinsicContentHeight(): Int { fun getIntrinsicContentHeight(): Int {
var result = 0 var result = 0
val width = screenWidth val width = screenWidth
val author = quoteViewAuthorTextView.text var authorTextViewIntrinsicHeight = 0
val authorTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(author, quoteViewAuthorTextView.paint, width) if (quoteViewAuthorTextView.isVisible) {
result += authorTextViewIntrinsicHeight val author = quoteViewAuthorTextView.text
authorTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(author, quoteViewAuthorTextView.paint, width)
result += authorTextViewIntrinsicHeight
}
val body = quoteViewBodyTextView.text val body = quoteViewBodyTextView.text
val bodyTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(body, quoteViewBodyTextView.paint, width) val bodyTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(body, quoteViewBodyTextView.paint, width)
result += bodyTextViewIntrinsicHeight result += bodyTextViewIntrinsicHeight

View File

@ -26,6 +26,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:gravity="center_vertical"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:orientation="vertical"> android:orientation="vertical">