mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-23 19:26:17 +00:00
Use custom emoji for avatars.
This commit is contained in:
@@ -30,6 +30,7 @@ class TextAvatarDrawable(
|
||||
textView.text = avatar.text
|
||||
textView.gravity = Gravity.CENTER
|
||||
textView.setTextColor(if (inverted) avatar.color.backgroundColor else avatar.color.foregroundColor)
|
||||
textView.setForceCustomEmoji(true)
|
||||
|
||||
layout.addView(textView)
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ import java.util.List;
|
||||
public class EmojiTextView extends AppCompatTextView {
|
||||
|
||||
private final boolean scaleEmojis;
|
||||
private final boolean forceCustom;
|
||||
|
||||
private static final char ELLIPSIS = '…';
|
||||
|
||||
private boolean forceCustom;
|
||||
private CharSequence previousText;
|
||||
private BufferType previousBufferType;
|
||||
private float originalFontSize;
|
||||
@@ -144,6 +144,13 @@ public class EmojiTextView extends AppCompatTextView {
|
||||
setText(previousText, BufferType.SPANNABLE);
|
||||
}
|
||||
|
||||
public void setForceCustomEmoji(boolean forceCustom) {
|
||||
if (this.forceCustom != forceCustom) {
|
||||
this.forceCustom = forceCustom;
|
||||
setText(previousText, BufferType.SPANNABLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void ellipsizeAnyTextForMaxLength() {
|
||||
if (maxLength > 0 && getText().length() > maxLength + 1) {
|
||||
SpannableStringBuilder newContent = new SpannableStringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user