mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-25 02:02:16 -05:00
avoid using paragraph style breaks by accident
This commit is contained in:
parent
9156665add
commit
b6f85ba0dd
@ -17,6 +17,8 @@ public class Message extends AbstractEntity {
|
|||||||
|
|
||||||
public static final String TABLENAME = "messages";
|
public static final String TABLENAME = "messages";
|
||||||
|
|
||||||
|
public static final String MERGE_SEPARATOR = "\u2029\n\n";
|
||||||
|
|
||||||
public static final int STATUS_RECEIVED = 0;
|
public static final int STATUS_RECEIVED = 0;
|
||||||
public static final int STATUS_UNSEND = 1;
|
public static final int STATUS_UNSEND = 1;
|
||||||
public static final int STATUS_SEND = 2;
|
public static final int STATUS_SEND = 2;
|
||||||
@ -396,7 +398,7 @@ public class Message extends AbstractEntity {
|
|||||||
public String getMergedBody() {
|
public String getMergedBody() {
|
||||||
final Message next = this.next();
|
final Message next = this.next();
|
||||||
if (this.mergeable(next)) {
|
if (this.mergeable(next)) {
|
||||||
return getBody().trim() + "\n\n" + next.getMergedBody();
|
return getBody().trim() + MERGE_SEPARATOR + next.getMergedBody();
|
||||||
}
|
}
|
||||||
return getBody().trim();
|
return getBody().trim();
|
||||||
}
|
}
|
||||||
|
@ -234,10 +234,11 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||||||
final String nick = UIHelper.getMessageDisplayName(message);
|
final String nick = UIHelper.getMessageDisplayName(message);
|
||||||
final String body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " ");
|
final String body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " ");
|
||||||
final SpannableString formattedBody = new SpannableString(body);
|
final SpannableString formattedBody = new SpannableString(body);
|
||||||
int i = body.indexOf("\n\n");
|
int i = body.indexOf(Message.MERGE_SEPARATOR);
|
||||||
while(i >= 0) {
|
while(i >= 0) {
|
||||||
formattedBody.setSpan(new RelativeSizeSpan(0.3f),i,i+2,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
final int end = i + Message.MERGE_SEPARATOR.length();
|
||||||
i = body.indexOf("\n\n",i+2);
|
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.getType() != Message.TYPE_PRIVATE) {
|
||||||
if (message.hasMeCommand()) {
|
if (message.hasMeCommand()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user