Fix quote view size calculation

This commit is contained in:
Niels Andriesse 2021-07-07 10:55:07 +10:00
parent b854a5d936
commit 9cd99c6c84

View File

@ -82,10 +82,10 @@ class VisibleMessageContentView : LinearLayout {
} else if (message is MmsMessageRecord && message.quote != null) { } else if (message is MmsMessageRecord && message.quote != null) {
val quote = message.quote!! val quote = message.quote!!
val quoteView = QuoteView(context, QuoteView.Mode.Regular) val quoteView = QuoteView(context, QuoteView.Mode.Regular)
// The max content width is the max message bubble size - 2 times the horizontal padding - the // The max content width is the max message bubble size - 2 times the horizontal padding - 2
// quote view content area's start margin. This unfortunately has to be calculated manually // times the horizontal margin. This unfortunately has to be calculated manually
// here to get the layout right. // here to get the layout right.
val maxContentWidth = (maxWidth - 2 * resources.getDimension(R.dimen.medium_spacing) - toPx(16, resources)).roundToInt() val maxContentWidth = (maxWidth - 2 * resources.getDimension(R.dimen.medium_spacing) - 2 * toPx(16, resources)).roundToInt()
val quoteText = if (quote.isOriginalMissing) { val quoteText = if (quote.isOriginalMissing) {
context.getString(R.string.QuoteView_original_missing) context.getString(R.string.QuoteView_original_missing)
} else { } else {