1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-29 20:32:22 -05:00

MessageListAdapter now uses conversations instead of channels

This commit is contained in:
Sebastian Kaspari 2010-03-10 20:46:07 +01:00
parent 5517660011
commit d1e6b0ffa8

View File

@ -22,7 +22,7 @@ package org.yaaic.adapter;
import java.util.LinkedList; import java.util.LinkedList;
import org.yaaic.model.Channel; import org.yaaic.model.Conversation;
import org.yaaic.model.Message; import org.yaaic.model.Message;
import android.content.Context; import android.content.Context;
@ -47,22 +47,22 @@ public class MessageListAdapter extends BaseAdapter
* @param channel * @param channel
* @param context * @param context
*/ */
public MessageListAdapter(Channel channel, Context context) public MessageListAdapter(Conversation conversation, Context context)
{ {
this.context = context; this.context = context;
// Render channel name as first message in channel // Render channel name as first message in channel
// XXX: There will be no messages shown if channel is empty, why? // XXX: There will be no messages shown if channel is empty, why?
Message header = new Message(channel.getName()); Message header = new Message(conversation.getName());
header.setColor(Message.COLOR_RED); header.setColor(Message.COLOR_RED);
messages.add(header.renderTextView(context)); messages.add(header.renderTextView(context));
for (Message message : channel.getHistory()) { for (Message message : conversation.getHistory()) {
messages.add(message.renderTextView(context)); messages.add(message.renderTextView(context));
} }
channel.clearBuffer(); conversation.clearBuffer();
} }
/** /**