diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-11 09:08:56 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-11 09:08:56 +0200 |
commit | 53e43daa0d8143d9a5abcd1391153b88a4702914 (patch) | |
tree | 8bc342a5a84bea2610f7954b9ded68fe5b9094e6 /src | |
parent | 21deda7b0029b729c94af9f1551278859b78f119 (diff) |
add a little bit of space between merged messages.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Message.java | 2 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index c87e5518..3c144f5c 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -396,7 +396,7 @@ public class Message extends AbstractEntity { public String getMergedBody() { final Message next = this.next(); if (this.mergeable(next)) { - return getBody().trim() + '\n' + next.getMergedBody(); + return getBody().trim() + "\n\n" + next.getMergedBody(); } return getBody().trim(); } 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 060bef71..0730f0e1 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -232,7 +232,13 @@ public class MessageAdapter extends ArrayAdapter<Message> { viewHolder.messageBody.setIncludeFontPadding(true); if (message.getBody() != null) { final String nick = UIHelper.getMessageDisplayName(message); - final String formattedBody = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " "); + final String body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " "); + final SpannableString formattedBody = new SpannableString(body); + int i = body.indexOf("\n\n"); + while(i >= 0) { + formattedBody.setSpan(new RelativeSizeSpan(0.2f),i,i+2,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + i = body.indexOf("\n\n",i+2); + } if (message.getType() != Message.TYPE_PRIVATE) { if (message.hasMeCommand()) { final Spannable span = new SpannableString(formattedBody); |