From 4f75ea0fd07fc6151d3503333d9462ba2246922a Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 21 Jul 2015 13:03:06 -0700 Subject: [PATCH] fix emoji resizing in EditTexts fixes #3720 closes #3741 // FREEBIE --- .../thoughtcrime/securesms/components/emoji/EmojiSpan.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/thoughtcrime/securesms/components/emoji/EmojiSpan.java b/src/org/thoughtcrime/securesms/components/emoji/EmojiSpan.java index a3e79cdd41..82fa28f722 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/EmojiSpan.java +++ b/src/org/thoughtcrime/securesms/components/emoji/EmojiSpan.java @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms.components.emoji; +import android.graphics.Paint; import android.graphics.Paint.FontMetricsInt; import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; @@ -15,4 +16,10 @@ public class EmojiSpan extends AnimatingImageSpan { : tv.getResources().getDimensionPixelSize(R.dimen.conversation_item_body_text_size); getDrawable().setBounds(0, 0, size, size); } + + @Override public int getSize(Paint paint, CharSequence text, int start, int end, + FontMetricsInt fm) + { + return getDrawable().getBounds().right; + } }