--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android" id="text1"
+ android:textStyle="bold"
+ android:singleLine="false"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"/>
\ No newline at end of file
--- /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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <ListView android:id="@+id/listMessages"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:scrollbars="horizontal"
+ />
+ <EditText android:id="@+id/sendText"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textSize="16sp"
+ android:autoText="false"
+ android:capitalize="none"
+ android:scrollHorizontally="true"/>
+ <Button android:id="@+id/send"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Send">
+ </Button>
+</LinearLayout>
--- 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<Map<String, String>> groupData = new ArrayList<Map<String, String>>();
List<List<Map<String, String>>> childData = new ArrayList<List<Map<String, String>>>();
--- /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<String> mMessages = new ArrayList<String>();
+
+ @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<String> adapter = new ArrayAdapter<String>(this, R.layout.messagelist, mMessages);
+ mList.setAdapter(adapter);
+ }
+}