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.res.Resources
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.widget.LinearLayout
import android.widget.RelativeLayout
@ -59,9 +60,12 @@ class QuoteView : LinearLayout {
fun getIntrinsicContentHeight(): Int {
var result = 0
val width = screenWidth
val author = quoteViewAuthorTextView.text
val authorTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(author, quoteViewAuthorTextView.paint, width)
result += authorTextViewIntrinsicHeight
var authorTextViewIntrinsicHeight = 0
if (quoteViewAuthorTextView.isVisible) {
val author = quoteViewAuthorTextView.text
authorTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(author, quoteViewAuthorTextView.paint, width)
result += authorTextViewIntrinsicHeight
}
val body = quoteViewBodyTextView.text
val bodyTextViewIntrinsicHeight = TextUtilities.getIntrinsicHeight(body, quoteViewBodyTextView.paint, width)
result += bodyTextViewIntrinsicHeight

View File

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