# HG changeset patch # User Nikita Kozlov # Date 1256927079 -3600 # Node ID 568fc0a4af7ad9b21b07a5c19d4471e09a343b81 # Parent a5a7e1af3611b6e8a307c73120d639de8c86808f# Parent 3be6014b6cf4d402e82ec192ecb45d4a52b18dca merge diff -r a5a7e1af3611 -r 568fc0a4af7a AndroidManifest.xml --- a/AndroidManifest.xml Fri Oct 30 19:22:49 2009 +0100 +++ b/AndroidManifest.xml Fri Oct 30 19:24:39 2009 +0100 @@ -30,6 +30,12 @@ android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" /> + + + + + + + + + + + + + + + + + + + diff -r a5a7e1af3611 -r 568fc0a4af7a res/values-fr/strings.xml --- a/res/values-fr/strings.xml Fri Oct 30 19:22:49 2009 +0100 +++ b/res/values-fr/strings.xml Fri Oct 30 19:24:39 2009 +0100 @@ -246,4 +246,6 @@ Oui Non Etes vous sûr de vouloir renvoyer l\'invitation ? +Saisissez votre message +Beem - Chat diff -r a5a7e1af3611 -r 568fc0a4af7a res/values/strings.xml --- a/res/values/strings.xml Fri Oct 30 19:22:49 2009 +0100 +++ b/res/values/strings.xml Fri Oct 30 19:24:39 2009 +0100 @@ -82,7 +82,7 @@ Modify my password Using Gmail Use my Gmail account - Beem - Settings - Proxy server + Proxy Use a proxy server Check this box if you\'re behind a proxy server Protocol @@ -91,7 +91,7 @@ Port definition of the proxy server Optional, allow to authenticate yourself on the proxy server Optional, allow to authenticate yourself on the proxy server - Beem - Settings - Advanced options + Advanced Use specific server option Modify reconnection delay Check this box if you want to use a specific server for your connection @@ -247,4 +247,6 @@ No Are you sure you want to resend invit? +Beem - Chat +Type your message diff -r a5a7e1af3611 -r 568fc0a4af7a src/com/beem/project/beem/ui/Chat.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/beem/project/beem/ui/Chat.java Fri Oct 30 19:24:39 2009 +0100 @@ -0,0 +1,180 @@ +package com.beem.project.beem.ui; + +import java.util.List; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.Handler; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; +import android.widget.EditText; +import android.widget.TextView; + +import com.beem.project.beem.R; +import com.beem.project.beem.service.Contact; +import com.beem.project.beem.service.Message; +import com.beem.project.beem.service.PresenceAdapter; +import com.beem.project.beem.service.aidl.IBeemRosterListener; +import com.beem.project.beem.service.aidl.IChat; +import com.beem.project.beem.service.aidl.IMessageListener; +import com.beem.project.beem.service.aidl.IRoster; +import com.beem.project.beem.service.aidl.IXmppFacade; +import com.beem.project.beem.utils.BeemBroadcastReceiver; + +public class Chat extends Activity { + + private static final String TAG = "Chat"; + private static final Intent SERVICE_INTENT = new Intent(); + static { + SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService")); + } + + private Handler _handler = new Handler(); + + private IRoster _roster; + private Contact _contact; + + private TextView _contactNameTextView; + private TextView _contactStatusMsgTextView; + private EditText _input; + + private final ServiceConnection _conn = new BeemServiceConnection(); + private BeemBroadcastReceiver _broadcastReceiver; + + + /** + * Constructor. + */ + public Chat() { + super(); + } + + /** + * {@inheritDoc}. + */ + protected void onCreate(Bundle savedBundle) { + super.onCreate(savedBundle); + + _contactNameTextView = (TextView) findViewById(R.id.chat_contact_name); + _contactStatusMsgTextView = (TextView) findViewById(R.id.chat_contact_status_msg); + + setContentView(R.layout.chat); + + _broadcastReceiver = new BeemBroadcastReceiver(_conn); + this.registerReceiver(_broadcastReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED)); + } + + /** + * {@inheritDoc}. + */ + protected void onDestroy() { + super.onDestroy(); + this.unregisterReceiver(_broadcastReceiver); + } + + /** + * {@inheritDoc}. + */ + protected void onStart() { + super.onStart(); + } + + /** + * {@inheritDoc}. + */ + protected void onStop() { + super.onStop(); + } + + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + + _contact = new Contact(intent.getData()); + } + + /** + * + * @author Jamu + * + */ + private final class BeemServiceConnection implements ServiceConnection { + + private IXmppFacade _xmppFacade; + + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + _xmppFacade = IXmppFacade.Stub.asInterface(service); + _broadcastReceiver.setBinded(true); + try { + _roster = _xmppFacade.getRoster(); + } catch (RemoteException e) { + Log.e(TAG, e.getMessage()); + } + } + + @Override + public void onServiceDisconnected(ComponentName name) { + _xmppFacade = null; + _broadcastReceiver.setBinded(false); + } + } + + + /** + * + * @author Jamu + * + */ + private class BeemRosterListener extends IBeemRosterListener.Stub { + + @Override + public void onEntriesAdded(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntriesDeleted(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntriesUpdated(List addresses) throws RemoteException { + // Nothing to do + } + + @Override + public void onEntryDeleteFromGroup(String group, String jid) throws RemoteException { + // Nothing to do + } + + @Override + public void onPresenceChanged(PresenceAdapter presence) throws RemoteException { + // TODO Auto-generated method stub + + } + } + + /** + * + * @author Jamu + * + */ + private class OnMessageListener extends IMessageListener.Stub { + + @Override + public void processMessage(IChat chat, Message msg) throws RemoteException { + // TODO Auto-generated method stub + } + + @Override + public void stateChanged(IChat chat) throws RemoteException { + // TODO Auto-generated method stub + + } + } +}