# HG changeset patch # User marseille # Date 1240527318 -7200 # Node ID 6e008c3695ffe4737ec1eedee60cb1132191dd5d # Parent 72bfb4fe5815426f6f01321a2bd22d80a58a8ef1# Parent ff0f63e92986856a640f49446a9babe2c5d93f2b Modification de la liste de contact pour qu'elle se reconnecte comme il faut. diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/away.png Binary file res/drawable/away.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/buddie_robot.png Binary file res/drawable/buddie_robot.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/chat.png Binary file res/drawable/chat.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/connecting.png Binary file res/drawable/connecting.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/dnd.png Binary file res/drawable/dnd.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/error.png Binary file res/drawable/error.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/invisible.png Binary file res/drawable/invisible.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/logo.jpg Binary file res/drawable/logo.jpg has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/message.png Binary file res/drawable/message.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/online.png Binary file res/drawable/online.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/requested.png Binary file res/drawable/requested.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/scrollbar_vertical_thumb.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/drawable/scrollbar_vertical_thumb.xml Fri Apr 24 00:55:18 2009 +0200 @@ -0,0 +1,21 @@ + + + + + + + diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/scrollbar_vertical_track.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/res/drawable/scrollbar_vertical_track.xml Fri Apr 24 00:55:18 2009 +0200 @@ -0,0 +1,21 @@ + + + + + + + diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/xmpp.jpg Binary file res/drawable/xmpp.jpg has changed diff -r ff0f63e92986 -r 6e008c3695ff res/drawable/xmpp.png Binary file res/drawable/xmpp.png has changed diff -r ff0f63e92986 -r 6e008c3695ff res/layout/contactlistcontact.xml --- a/res/layout/contactlistcontact.xml Thu Apr 23 22:33:20 2009 +0200 +++ b/res/layout/contactlistcontact.xml Fri Apr 24 00:55:18 2009 +0200 @@ -9,8 +9,10 @@ android:gravity="center_vertical" > @@ -30,8 +32,11 @@ diff -r ff0f63e92986 -r 6e008c3695ff res/layout/sendim.xml --- a/res/layout/sendim.xml Thu Apr 23 22:33:20 2009 +0200 +++ b/res/layout/sendim.xml Fri Apr 24 00:55:18 2009 +0200 @@ -7,31 +7,35 @@ android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:paddingLeft="10px" - android:paddingRight="10px" android:background="@drawable/beem_sendim_header_1" android:gravity="center_vertical" > - + /> + android:paddingLeft="10sp" /> + android:paddingLeft="15sp" /> @@ -76,6 +80,9 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/beem_sendim_textview" + android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track" + android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb" + android:scrollbarSize="12dip" android:layout_weight="1"> - + diff -r ff0f63e92986 -r 6e008c3695ff src/com/beem/project/beem/BeemApplication.java --- a/src/com/beem/project/beem/BeemApplication.java Thu Apr 23 22:33:20 2009 +0200 +++ b/src/com/beem/project/beem/BeemApplication.java Fri Apr 24 00:55:18 2009 +0200 @@ -5,6 +5,7 @@ import java.util.LinkedList; import java.util.List; + import android.app.Activity; import android.app.Application; import android.app.ProgressDialog; @@ -18,9 +19,13 @@ import android.os.Message; import android.os.RemoteException; import android.util.Log; +import android.widget.Toast; + import com.beem.project.beem.service.aidl.IBeemConnectionListener; import com.beem.project.beem.service.aidl.IXmppConnection; import com.beem.project.beem.service.aidl.IXmppFacade; +import com.beem.project.beem.ui.AddContact; +import com.beem.project.beem.ui.ContactList; import com.beem.project.beem.utils.Status; /** @@ -61,7 +66,6 @@ try { mConnection = mFacade.createConnection(); if (!mConnection.isAuthentificated()) { - mProgressDialog.show(); mConnection.addConnectionListener(mConnectionListener); mApplicationContext.startService(BeemApplication.SERVICE_INTENT); }else { @@ -111,6 +115,8 @@ */ public synchronized void startBeemService() { if (!mIsConnected) { + mProgressDialog.setMessage("Connecting..."); + mProgressDialog.show(); // the connection will be made on service connect mApplicationContext.bindService(BeemApplication.SERVICE_INTENT, mServConn, BIND_AUTO_CREATE); } @@ -207,7 +213,6 @@ * Constructor. */ public ConnectionListener() { - } /** @@ -215,9 +220,7 @@ */ @Override public void connectionClosed() throws RemoteException { - // TODO Auto-generated method stub - Log.e("BeemApp", "test1"); - + Log.e(TAG, "Connection Close"); } /** @@ -252,8 +255,6 @@ */ @Override public void reconnectingIn(int seconds) throws RemoteException { - // TODO Auto-generated method stub - mProgressDialog.show(); } /** @@ -261,9 +262,6 @@ */ @Override public void reconnectionFailed() throws RemoteException { - // TODO Auto-generated method stub - Log.e("BeemApp", "test3"); - } /** @@ -271,8 +269,6 @@ */ @Override public void reconnectionSuccessful() throws RemoteException { - // TODO Auto-generated method stub - } @Override diff -r ff0f63e92986 -r 6e008c3695ff src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Apr 23 22:33:20 2009 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Fri Apr 24 00:55:18 2009 +0200 @@ -88,7 +88,10 @@ return true; } catch (XMPPException e) { Log.e(TAG, "Error while connecting", e); - mConListener.connectionFailed(e.getXMPPError().getMessage()); // + if (e.getXMPPError() != null) + mConListener.connectionFailed(e.getXMPPError().getMessage()); // + else + mConListener.connectionFailed("Error On Connection"); } return false; } diff -r ff0f63e92986 -r 6e008c3695ff src/com/beem/project/beem/ui/ChangeStatus.java --- a/src/com/beem/project/beem/ui/ChangeStatus.java Thu Apr 23 22:33:20 2009 +0200 +++ b/src/com/beem/project/beem/ui/ChangeStatus.java Fri Apr 24 00:55:18 2009 +0200 @@ -1,16 +1,14 @@ package com.beem.project.beem.ui; import android.app.Activity; - +import android.content.Context; import android.content.Intent; - -import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; - import android.os.Bundle; import android.os.Handler; import android.os.RemoteException; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; @@ -22,7 +20,6 @@ import com.beem.project.beem.BeemApplication; import com.beem.project.beem.BeemService; import com.beem.project.beem.R; - import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.utils.Status; @@ -44,18 +41,20 @@ private static final int UNAVAILABLE_IDX = 4; private SharedPreferences mSettings; private ArrayAdapter mAdapter; - private Context mContext = this; private Toast mToast; + private static Integer nb = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.changestatus); - + + nb++; + Log.i("nb de oncreate changestatus", nb.toString()); // Beem Application specific mHandler = new Handler(); mBeemApplication = BeemApplication.getApplication(this); - + + setContentView(R.layout.changestatus); mStatusText = (TextView) findViewById(R.id.ChangeStatusText); mOk = (Button) findViewById(R.id.ChangeStatusOk); mClear = (Button) findViewById(R.id.ChangeStatusClear); @@ -67,7 +66,7 @@ mAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, STATUS); mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mSpinner.setAdapter(mAdapter); - mToast = Toast.makeText(mContext, R.string.ChangeStatusOk, Toast.LENGTH_LONG); + mToast = Toast.makeText(this, R.string.ChangeStatusOk, Toast.LENGTH_LONG); showSettings(); } diff -r ff0f63e92986 -r 6e008c3695ff src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Thu Apr 23 22:33:20 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 00:55:18 2009 +0200 @@ -44,6 +44,7 @@ private IXmppFacade mService = null; private BeemApplication mBeemApplication; private BeemRosterListener mRosterListener; + private SharedPreferences mSettings; private IRoster mRoster; @SuppressWarnings("unchecked") @@ -62,7 +63,20 @@ super.onCreate(saveBundle); mBeemApplication = BeemApplication.getApplication(this); mRosterListener = new BeemRosterListener(); + mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE); mBeemApplication.startBeemService(); + + // bug fixe temporaire des betises de marseille + /* + * SharedPreferences mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE); + * SharedPreferences.Editor editor = mSettings.edit(); editor.putInt(getString(R.string.PreferencePortKey), + * 5222); editor.commit(); + */ + } + + @Override + protected void onResume() { + super.onResume(); mBeemApplication.callWhenConnectedToServer(new Handler(), new Runnable() { @Override public void run() { @@ -82,14 +96,6 @@ callbackShowContactList(); } }); - - // bug fixe temporaire des betises de marseille - /* - SharedPreferences mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE); - SharedPreferences.Editor editor = mSettings.edit(); - editor.putInt(getString(R.string.PreferencePortKey), 5222); - editor.commit(); - */ } @Override @@ -153,19 +159,13 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PREFERENCECHANGED) { if (resultCode == RESULT_OK) { + setListAdapter(null); mBeemApplication.stopBeemService(); mBeemApplication.startBeemService(); } } } - private boolean isStatusOK(int status) { - if (status == Status.CONTACT_STATUS_AVAILABLE || status == Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT - || status == Status.CONTACT_STATUS_AWAY || status == Status.CONTACT_STATUS_BUSY) - return true; - return false; - } - private void showContactList(List listGroup, List listContact) { ExpandableListAdapter Adapter; List> groupData = new ArrayList>(); diff -r ff0f63e92986 -r 6e008c3695ff src/com/beem/project/beem/ui/ContactListSettings.java --- a/src/com/beem/project/beem/ui/ContactListSettings.java Thu Apr 23 22:33:20 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 00:55:18 2009 +0200 @@ -1,8 +1,11 @@ package com.beem.project.beem.ui; import android.app.Activity; +import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; @@ -11,6 +14,7 @@ import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Spinner; +import android.widget.TextView; import android.widget.AdapterView.OnItemSelectedListener; import com.beem.project.beem.R; @@ -48,16 +52,18 @@ showSettings(); Button ok = (Button) findViewById(R.id.ok); ok.setOnClickListener(mOkListener); - + Button reco = (Button) findViewById(R.id.reconnect); - reco.setOnClickListener(new OnClickListener () { + reco.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - setResult(RESULT_OK); - finish(); + if (mSettings.getString(getString(R.string.PreferenceHostKey), "") != "") { + setResult(RESULT_OK); + finish(); + } } - + }); } @@ -92,7 +98,7 @@ private OnClickListener mOkListener = new OnClickListener() { public void onClick(View v) { SharedPreferences.Editor editor = mSettings.edit(); - + if (isChanged(R.id.host, R.string.PreferenceHostKey)) { editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host)); mIsChanged = true; @@ -114,8 +120,10 @@ editor.putString(getString(R.string.PreferenceProxyHost), getWidgetText(R.id.proxy_host)); mIsChanged = true; } - if (Integer.parseInt(getWidgetText(R.id.proxy_port)) != mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080) ) { - editor.putInt(getString(R.string.PreferenceProxyPort), Integer.parseInt(getWidgetText(R.id.proxy_port))); + if (Integer.parseInt(getWidgetText(R.id.proxy_port)) != mSettings.getInt( + getString(R.string.PreferenceProxyPort), 1080)) { + editor + .putInt(getString(R.string.PreferenceProxyPort), Integer.parseInt(getWidgetText(R.id.proxy_port))); mIsChanged = true; } if (isChanged(R.id.proxy_login, R.string.PreferenceProxyUser)) {