Fix cut off icon in conversation header.

This commit is contained in:
Cody Henthorne 2024-02-27 10:12:02 -05:00 committed by Alex Hart
parent e18e4454e4
commit 957221e118

View file

@ -177,12 +177,12 @@ public class ConversationHeaderView extends ConstraintLayout {
private @NonNull CharSequence prependIcon(@NonNull CharSequence input, @DrawableRes int iconRes) { private @NonNull CharSequence prependIcon(@NonNull CharSequence input, @DrawableRes int iconRes) {
Drawable drawable = ContextCompat.getDrawable(getContext(), iconRes); Drawable drawable = ContextCompat.getDrawable(getContext(), iconRes);
Preconditions.checkNotNull(drawable); Preconditions.checkNotNull(drawable);
drawable.setBounds(0, 0, (int) DimensionUnit.DP.toPixels(20), (int) DimensionUnit.DP.toPixels(20)); drawable.setBounds(0, 0, (int) DimensionUnit.SP.toPixels(20), (int) DimensionUnit.SP.toPixels(20));
drawable.setColorFilter(ContextCompat.getColor(getContext(), R.color.signal_colorOnSurface), PorterDuff.Mode.SRC_ATOP); drawable.setColorFilter(ContextCompat.getColor(getContext(), R.color.signal_colorOnSurface), PorterDuff.Mode.SRC_ATOP);
return new SpannableStringBuilder() return new SpannableStringBuilder()
.append(SpanUtil.buildCenteredImageSpan(drawable)) .append(SpanUtil.buildCenteredImageSpan(drawable))
.append(SpanUtil.space(8, DimensionUnit.DP)) .append(SpanUtil.space(8, DimensionUnit.SP))
.append(input); .append(input);
} }