fix emoji resizing in EditTexts

fixes #3720
closes #3741
// FREEBIE
This commit is contained in:
Jake McGinty 2015-07-21 13:03:06 -07:00 committed by Moxie Marlinspike
parent 12b8eee86f
commit 4f75ea0fd0

View File

@ -1,5 +1,6 @@
package org.thoughtcrime.securesms.components.emoji; package org.thoughtcrime.securesms.components.emoji;
import android.graphics.Paint;
import android.graphics.Paint.FontMetricsInt; import android.graphics.Paint.FontMetricsInt;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
@ -15,4 +16,10 @@ public class EmojiSpan extends AnimatingImageSpan {
: tv.getResources().getDimensionPixelSize(R.dimen.conversation_item_body_text_size); : tv.getResources().getDimensionPixelSize(R.dimen.conversation_item_body_text_size);
getDrawable().setBounds(0, 0, size, 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;
}
} }