Render emoji's properly in quote bubbles.

Unfortunately, the change wasn't as simple as just switching to use our
EmojiTextView. That view only supported single-line text. I added
support for multi-line text.

Fixes #7704.
This commit is contained in:
Greyson Parrelli
2018-04-20 13:53:23 -07:00
committed by Moxie Marlinspike
parent cbe394025d
commit 6fbbc9d078
3 changed files with 32 additions and 44 deletions

View File

@@ -28,9 +28,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -97,17 +94,6 @@ public class ViewUtil {
parent.addView(toAdd, childIndex > -1 ? childIndex : defaultIndex);
}
public static CharSequence ellipsize(@Nullable CharSequence text, @NonNull TextView view) {
if (TextUtils.isEmpty(text) || view.getWidth() == 0 || view.getEllipsize() != TruncateAt.END) {
return text;
} else {
return TextUtils.ellipsize(text,
view.getPaint(),
view.getWidth() - view.getPaddingRight() - view.getPaddingLeft(),
TruncateAt.END);
}
}
@SuppressWarnings("unchecked")
public static <T extends View> T inflateStub(@NonNull View parent, @IdRes int stubId) {
return (T)((ViewStub)parent.findViewById(stubId)).inflate();