mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
revert emoji ellipsizing temporarily
it doesn't react to layout changes correct, better to not have it for the time being. closes #3718 closes #3812 // FREEBIE
This commit is contained in:
parent
5cf95f5b3d
commit
e145b8171d
@ -4,17 +4,13 @@ import android.text.InputFilter;
|
||||
import android.text.Spannable;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextUtils.TruncateAt;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class EmojiFilter implements InputFilter, OnGlobalLayoutListener {
|
||||
public class EmojiFilter implements InputFilter {
|
||||
private TextView view;
|
||||
|
||||
public EmojiFilter(TextView view) {
|
||||
this.view = view;
|
||||
view.getViewTreeObserver().addOnGlobalLayoutListener(this);
|
||||
}
|
||||
|
||||
@Override public CharSequence filter(CharSequence source, int start, int end,
|
||||
@ -26,18 +22,6 @@ public class EmojiFilter implements InputFilter, OnGlobalLayoutListener {
|
||||
if (source instanceof Spanned) {
|
||||
TextUtils.copySpansFrom((Spanned) source, start, end, null, emojified, 0);
|
||||
}
|
||||
if (view.getWidth() == 0 || view.getEllipsize() != TruncateAt.END) {
|
||||
return emojified;
|
||||
} else {
|
||||
return TextUtils.ellipsize(emojified,
|
||||
view.getPaint(),
|
||||
view.getWidth() - view.getPaddingRight() - view.getPaddingLeft(),
|
||||
TruncateAt.END);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override public void onGlobalLayout() {
|
||||
view.invalidate();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user