# HG changeset patch # User Philippe Lago # Date 1238082937 -3600 # Node ID 5b42427793c53da4e392008949548edc089e631a # Parent b915994d895e6f7e85517156e45cfa56c49feaef# Parent cd37b4d817ec3cff860e94e307b5601ca15b7096 merge diff -r b915994d895e -r 5b42427793c5 res/layout/messagelist.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/layout/messagelist.xml Thu Mar 26 16:55:37 2009 +0100 @@ -0,0 +1,6 @@ + + \ No newline at end of file diff -r b915994d895e -r 5b42427793c5 res/layout/sendim.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/layout/sendim.xml Thu Mar 26 16:55:37 2009 +0100 @@ -0,0 +1,26 @@ + + + + + + diff -r b915994d895e -r 5b42427793c5 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Sat Mar 21 00:00:14 2009 +0100 +++ b/src/com/beem/project/beem/ui/ContactList.java Thu Mar 26 16:55:37 2009 +0100 @@ -32,6 +32,7 @@ private void showContactList() { ExpandableListAdapter Adapter; + List> groupData = new ArrayList>(); List>> childData = new ArrayList>>(); diff -r b915994d895e -r 5b42427793c5 src/com/beem/project/beem/ui/SendIM.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/beem/project/beem/ui/SendIM.java Thu Mar 26 16:55:37 2009 +0100 @@ -0,0 +1,52 @@ +package com.beem.project.beem.ui; + +import java.util.ArrayList; + +import org.jivesoftware.smack.packet.Message; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ListView; + +import com.beem.project.beem.R; + +public class SendIM extends Activity { + private EditText mToSend; + private ListView mList; + private ArrayList mMessages = new ArrayList(); + + @Override + public void onCreate(Bundle saveBundle) { + super.onCreate(saveBundle); + setContentView(R.layout.sendim); + mToSend = (EditText) findViewById(R.id.sendText); + mList = (ListView) findViewById(R.id.listMessages); + + Button send = (Button) this.findViewById(R.id.send); + send.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + String text = mToSend.getText().toString(); + if (text != "") + { + /* + * Prepare the message to send + * */ + Message msg = new Message("barbu", Message.Type.chat); + msg.setBody(text); + mMessages.add("Barbu says:\n" + text); + mToSend.setText(""); + setListAdapter(); + } + } + }); + } + + private void setListAdapter() { + ArrayAdapter adapter = new ArrayAdapter(this, R.layout.messagelist, mMessages); + mList.setAdapter(adapter); + } +}