diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-11 14:18:30 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-11 14:18:30 +0200 |
commit | b6f85ba0dd765e72a89a85461b3f8c48f038270c (patch) | |
tree | 38801be19134e7625c3933d0e0cab3742350b765 /src/main/java/eu/siacs/conversations/ui/adapter | |
parent | 9156665addb5541cacf640f033f03cec0937f052 (diff) |
avoid using paragraph style breaks by accident
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/adapter')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 7 |
1 files changed, 4 insertions, 3 deletions
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 ec351622..29dfced2 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -234,10 +234,11 @@ public class MessageAdapter extends ArrayAdapter<Message> { final String nick = UIHelper.getMessageDisplayName(message); final String body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " "); final SpannableString formattedBody = new SpannableString(body); - int i = body.indexOf("\n\n"); + int i = body.indexOf(Message.MERGE_SEPARATOR); while(i >= 0) { - formattedBody.setSpan(new RelativeSizeSpan(0.3f),i,i+2,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - i = body.indexOf("\n\n",i+2); + final int end = i + Message.MERGE_SEPARATOR.length(); + formattedBody.setSpan(new RelativeSizeSpan(0.3f),i,end,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + i = body.indexOf(Message.MERGE_SEPARATOR,end); } if (message.getType() != Message.TYPE_PRIVATE) { if (message.hasMeCommand()) { |