--- a/AndroidManifest.xml Tue Apr 21 17:13:34 2009 +0200
+++ b/AndroidManifest.xml Tue Apr 21 17:14:09 2009 +0200
@@ -11,6 +11,7 @@
</activity>
<activity android:name=".ui.ContactListSettings" android:label="@string/app_name" />
<activity android:name=".ui.SendIM" android:label="@string/app_name" />
+ <activity android:name=".ui.ChangeStatus" android:label="@string/app_name" />
<service android:name="BeemService" android:enabled="true"
android:label="Beem Service" android:permission="com.beem.project.beem.BEEM_SERVICE">
<intent-filter>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/changestatus.xml Tue Apr 21 17:14:09 2009 +0200
@@ -0,0 +1,40 @@
+<?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">
+
+ <Spinner android:id="@+id/ChangeStatusSpinner"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:drawSelectorOnTop="true"/>
+
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/ChangeStatusText"
+ android:textColor="@color/blue_sky"/>
+
+ <EditText android:id="@+id/ChangeStatusText"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:lines="6"/>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+
+ <Button android:id="@+id/ChangeStatusOk"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/OkButton"/>
+
+ <Button android:id="@+id/ChangeStatusClear"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/ClearButton"/>
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file
--- a/res/layout/contactlistsettings.xml Tue Apr 21 17:13:34 2009 +0200
+++ b/res/layout/contactlistsettings.xml Tue Apr 21 17:14:09 2009 +0200
@@ -13,26 +13,26 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Host/Port:"
- android:minWidth="70dp"
+ android:minWidth="90dp"
/>
<EditText android:id="@+id/host"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="16sp"
android:autoText="false"
android:capitalize="none"
- android:minWidth="150dp"
+ android:layout_weight="2"
android:scrollHorizontally="true"/>
<EditText android:id="@+id/port"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="16sp"
android:autoText="false"
- android:minWidth="80dp"
android:capitalize="none"
+ android:layout_weight="3"
android:scrollHorizontally="true"/>
</LinearLayout>
@@ -45,15 +45,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Userid:"
- android:minWidth="70dp"
+ android:minWidth="90dp"
/>
<EditText android:id="@+id/userid"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="16sp"
android:autoText="false"
- android:minWidth="250dp"
android:capitalize="none"
android:scrollHorizontally="true"/>
</LinearLayout>
@@ -66,23 +65,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password:"
- android:minWidth="70dp"
+ android:minWidth="90dp"
/>
<EditText android:id="@+id/password"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
android:textSize="16sp"
android:autoText="false"
- android:minWidth="250dp"
android:capitalize="none"
android:scrollHorizontally="true"/>
</LinearLayout>
<Button android:id="@+id/ok"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
android:text="OK">
<requestFocus/>
</Button>
--- a/res/values/strings.xml Tue Apr 21 17:13:34 2009 +0200
+++ b/res/values/strings.xml Tue Apr 21 17:14:09 2009 +0200
@@ -1,19 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Beem</string>
-
+ <string name="OkButton">Ok</string>
+ <string name="ClearButton">Clear</string>
+
<!-- Beem class -->
<string name="BeemJabberID">Jabber ID</string>
+ <!-- BeemApplication class -->
+
+ <string name="BeemApplicationConnect">Connecting...</string>
+
<!-- BeemService class -->
+
<string name="BeemServiceDescription">Use the Beem Service</string>
<string name="BeemServiceCreated">BeemService Created</string>
<string name="BeemServiceDestroyed">BeemService destroyed</string>
<!-- Preferences informations -->
+
<string name="PreferenceFileName">Beem</string>
-
<string name="PreferenceHostKey">host</string>
<string name="PreferenceJID">Jabber ID</string><string name="PreferenceLoginKey">login</string><string name="PreferencePasswordKey">password</string>
<string name="PreferencePortKey">port</string>
@@ -28,12 +35,18 @@
<string name="PreferenceProxyTypeSocks5">SOCKS5</string>
<!-- SendIM class -->
+
<string name="SendIMSays"> says :\n</string>
+ <string name="SendIMYouSay">You say :\n</string>
<string name="SendIMToSendHint">Tip text here</string>
<string name="SendIMState">Is : </string>
<string name="SendIMFrom">and is speaking from : </string>
<string name="SendIMSmiley">Insert a smiley</string>
<string name="SendIMLoginHint">login</string>
<string name="SendIMNoStatusSet">No status set</string>
+
+ <!-- ChangeStatus class -->
+
+ <string name="ChangeStatusText">Type here your status message :</string>
</resources>
--- a/res/values/style.xml Tue Apr 21 17:13:34 2009 +0200
+++ b/res/values/style.xml Tue Apr 21 17:14:09 2009 +0200
@@ -6,7 +6,7 @@
<style name="customtheme.contactList">
<item name="android:windowBackground">@drawable/background</item>
<item name="android:windowNoTitle">true</item>
- <item name="android:textColor">#FFFF00</item>
+ <item name="android:textColor">#000000</item>
<item name="android:typeface">sans</item>
<item name="android:textSize">18sp</item>
@@ -15,9 +15,17 @@
<style name="customtheme.jungle">
<item name="android:windowBackground">@drawable/background</item>
<item name="android:windowNoTitle">true</item>
- <item name="android:textColor">#FFFF00</item>
+ <item name="android:textColor">#FFFFFF</item>
<item name="android:typeface">sans</item>
<item name="android:textSize">18sp</item>
</style>
+ <style name="customtheme.spinner">
+ <item name="android:windowBackground">@drawable/background</item>
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:textColor">#FF0000</item>
+ <item name="android:typeface">sans</item>
+ <item name="android:textSize">18sp</item>
+ </style>
+
</resources>
\ No newline at end of file
--- a/src/com/beem/project/beem/BeemApplication.java Tue Apr 21 17:13:34 2009 +0200
+++ b/src/com/beem/project/beem/BeemApplication.java Tue Apr 21 17:14:09 2009 +0200
@@ -95,8 +95,8 @@
mBeemApp.mActivity = activity;
mBeemApp.mProgressDialog = new ProgressDialog(activity);
mBeemApp.mProgressDialog.setTitle("Beem");
- mBeemApp.mProgressDialog.setIcon(R.drawable.logo);
- mBeemApp.mProgressDialog.setMessage("Connexion en cours");
+ //mBeemApp.mProgressDialog.setIcon(R.drawable.logo);
+ mBeemApp.mProgressDialog.setMessage("Connecting...");
mBeemApp.mApplicationContext = activity.getApplication();
mBeemApp.mPrivateResources = activity.getResources();
mBeemApp.onCreate();
@@ -215,8 +215,8 @@
*/
@Override
public void connectionClosedOnError() throws RemoteException {
- mBeemApp.mProgressDialog.setMessage("Connexion closed on error");
- Log.e(TAG,"onnectionClosedOnError");
+ mBeemApp.mProgressDialog.setMessage("Connection closed on error");
+ Log.e(TAG,"ConnectionClosedOnError");
// TODO afficher une notification et reafficher le progress dialog
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java Tue Apr 21 17:14:09 2009 +0200
@@ -0,0 +1,53 @@
+package com.beem.project.beem.ui;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.beem.project.beem.R;
+
+public class ChangeStatus extends Activity {
+
+ private TextView mTextStatus;
+ private Button mOk;
+ private Button mClear;
+ private static final String[] mStatus = {"Available for chat", "Available", "Busy", "Away",
+ "Unavailable", "Disconnected"};
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.changestatus);
+
+ mTextStatus = (TextView) findViewById(R.id.ChangeStatusText);
+ mOk = (Button) findViewById(R.id.ChangeStatusOk);
+ mClear = (Button) findViewById(R.id.ChangeStatusClear);
+ mOk.setOnClickListener(mOnClickOk);
+ mClear.setOnClickListener(mOnClickClear);
+
+
+ Spinner s1 = (Spinner) findViewById(R.id.ChangeStatusSpinner);
+ ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
+ android.R.layout.simple_spinner_item, mStatus);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ s1.setAdapter(adapter);
+ }
+
+ private OnClickListener mOnClickOk = new OnClickListener() {
+ public void onClick(View v) {
+
+ };
+ };
+
+ private OnClickListener mOnClickClear = new OnClickListener() {
+ public void onClick(View v) {
+ mTextStatus.setText(null);
+ };
+ };
+}
--- a/src/com/beem/project/beem/ui/SendIM.java Tue Apr 21 17:13:34 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Tue Apr 21 17:14:09 2009 +0200
@@ -1,14 +1,11 @@
package com.beem.project.beem.ui;
-import java.util.ArrayList;
-
import android.app.Activity;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
-import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
@@ -40,7 +37,7 @@
public class SendIM extends Activity implements OnClickListener,
OnKeyListener {
private EditText mToSend;
- private ArrayList<String> mMessages = new ArrayList<String>();
+ //private ArrayList<String> mMessages = new ArrayList<String>();
//private ArrayAdapter<String> mAdapter;
private SendIMDialogSmiley mSmyDialog;
private SharedPreferences mSet;
@@ -156,8 +153,6 @@
if (mSpeak)
mSpeak = false;
String text = mToSend.getText().toString();
- String from = mGlobalSettings.getString(
- getString(R.string.PreferenceJID), "You");
if (!text.equals("")) {
Message msg = new Message(mContact.getJID(), Message.MSG_TYPE_CHAT);
msg.setBody(text);
@@ -167,9 +162,8 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- //mAdapter.add(from + getString(R.string.SendIMSays) + text);
if (!mSpeak)
- mText.append(from + getString(R.string.SendIMSays) + text + "\n");
+ mText.append(getString(R.string.SendIMYouSay) + text + "\n");
else
mText.append(text + "\n");
mToSend.setText(null);