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.
This commit is contained in:
Rashad Sookram 2022-03-11 11:38:56 -05:00
parent 1f57e1f366
commit 9056371c41

View file

@ -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();