Fix quote preview being cut off.

When determining the height to force for the animation, the text was
being measured assuming it had infinite width, which made
it seem like it could fit on one line.
fork-5.53.8
Rashad Sookram 2022-03-11 11:38:56 -05:00
rodzic 1f57e1f366
commit 9056371c41
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -187,7 +187,13 @@ public class InputPanel extends LinearLayout
: 0;
this.quoteView.setVisibility(VISIBLE);
this.quoteView.measure(0, 0);
int maxWidth = composeContainer.getWidth();
if (quoteView.getLayoutParams() instanceof MarginLayoutParams) {
MarginLayoutParams layoutParams = (MarginLayoutParams) quoteView.getLayoutParams();
maxWidth -= layoutParams.leftMargin + layoutParams.rightMargin;
}
this.quoteView.measure(MeasureSpec.makeMeasureSpec(maxWidth, MeasureSpec.AT_MOST), 0);
if (quoteAnimator != null) {
quoteAnimator.cancel();