From 77c3a2423f7b98f6924f8573acd5870b7d4e96e0 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Wed, 14 Apr 2010 20:17:36 +0200 Subject: [PATCH] MessageListAdapter: Fixed wrong message order on addBulkMessages - and clearBuffer() after adding (ConversationActivity) --- src/org/yaaic/activity/ConversationActivity.java | 1 + src/org/yaaic/adapter/MessageListAdapter.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/yaaic/activity/ConversationActivity.java b/src/org/yaaic/activity/ConversationActivity.java index ebb8bb2..d54f142 100644 --- a/src/org/yaaic/activity/ConversationActivity.java +++ b/src/org/yaaic/activity/ConversationActivity.java @@ -176,6 +176,7 @@ public class ConversationActivity extends Activity implements ServiceConnection, if (mAdapter != null) { mAdapter.addBulkMessages(conversation.getBuffer()); + conversation.clearBuffer(); } } diff --git a/src/org/yaaic/adapter/MessageListAdapter.java b/src/org/yaaic/adapter/MessageListAdapter.java index d6907e7..c5e570a 100644 --- a/src/org/yaaic/adapter/MessageListAdapter.java +++ b/src/org/yaaic/adapter/MessageListAdapter.java @@ -101,7 +101,7 @@ public class MessageListAdapter extends BaseAdapter Context mContext = this.context; int mSize = messages.size(); - for (int i = 0; i < mSize; i++) { + for (int i = mSize - 1; i > -1; i--) { mMessages.add(messages.get(i).renderTextView(mContext)); if (mMessages.size() > Conversation.HISTORY_SIZE) {