From 21deda7b0029b729c94af9f1551278859b78f119 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 11 May 2015 08:45:38 +0200 Subject: no font padding on red hearts --- src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index b23709fc..060bef71 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -210,12 +210,13 @@ public class MessageAdapter extends ArrayAdapter { viewHolder.messageBody.setTextIsSelectable(false); } - private void displayHeartMesage(final ViewHolder viewHolder, final String body) { + private void displayHeartMessage(final ViewHolder viewHolder, final String body) { if (viewHolder.download_button != null) { viewHolder.download_button.setVisibility(View.GONE); } viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.VISIBLE); + viewHolder.messageBody.setIncludeFontPadding(false); Spannable span = new SpannableString(body); span.setSpan(new RelativeSizeSpan(4.0f), 0, body.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); span.setSpan(new ForegroundColorSpan(activity.getWarningTextColor()), 0, body.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -228,6 +229,7 @@ public class MessageAdapter extends ArrayAdapter { } viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.VISIBLE); + viewHolder.messageBody.setIncludeFontPadding(true); if (message.getBody() != null) { final String nick = UIHelper.getMessageDisplayName(message); final String formattedBody = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " "); @@ -514,7 +516,7 @@ public class MessageAdapter extends ArrayAdapter { displayLocationMessage(viewHolder,message); } else { if (message.bodyIsHeart()) { - displayHeartMesage(viewHolder," "+message.getBody().trim()+" "); + displayHeartMessage(viewHolder, message.getBody().trim()); } else { displayTextMessage(viewHolder, message); } -- cgit v1.2.3