CustomEmojiHelper: experimental bigger emoji 2x in size

This commit is contained in:
Alibek Omarov 2019-12-13 06:34:07 +03:00
parent d1cb15f821
commit 07bcdb0792
1 changed files with 7 additions and 6 deletions

View File

@ -96,13 +96,14 @@ public class CustomEmojiHelper {
it covers the whole text */ it covers the whole text */
Paint.FontMetricsInt metrics = paint.getFontMetricsInt(); Paint.FontMetricsInt metrics = paint.getFontMetricsInt();
if (fm != null) { if (fm != null) {
fm.top = metrics.top; fm.top = (int)((float)metrics.top * 1.3);
fm.ascent = metrics.ascent; fm.ascent = (int)((float)metrics.ascent * 1.3);
fm.descent = metrics.descent; fm.descent = (int)((float)metrics.descent * 2.0);
fm.bottom = metrics.bottom; fm.bottom = (int)((float)metrics.bottom * 3.5);
// fm.leading = (int)((float)metrics.leading); // useless to change
} }
return (int) (paint.getTextSize()*1.2); return (int) (paint.getTextSize()*2.0);
} }
@Override @Override
@ -111,7 +112,7 @@ public class CustomEmojiHelper {
if (imageDrawable == null) return; if (imageDrawable == null) return;
canvas.save(); canvas.save();
int emojiSize = (int) (paint.getTextSize() * 1.1); int emojiSize = (int) (paint.getTextSize() * 2.0);
imageDrawable.setBounds(0, 0, emojiSize, emojiSize); imageDrawable.setBounds(0, 0, emojiSize, emojiSize);
int transY = bottom - imageDrawable.getBounds().bottom; int transY = bottom - imageDrawable.getBounds().bottom;