- Modification de la methode setName dans la classe Contact afin de gerer le cas ou le contact n'aurait pas d'alias.
- Suppression et correction de probleme de redondance concernant l'alias dans les activites SendIM et ContactList.
- Correction de quelques traductions dans la langue de Shakespeare.
--- a/res/values-en/strings.xml Fri Oct 23 16:26:59 2009 +0200
+++ b/res/values-en/strings.xml Fri Oct 23 17:56:58 2009 +0200
@@ -55,7 +55,7 @@
<string name="SendIMSays"> %s says :\n%s\n</string>
<string name="SendIMYouSay">You say :\n%s\n</string>
<string name="SendIMSameSpeaker">%s\n</string>
- <string name="SendIMToSendHint">Tip text here</string>
+ <string name="SendIMToSendHint">Type your message</string>
<string name="SendIMState">Is : </string>
<string name="SendIMErrorMsg">Error : %s\n</string>
<string name="SendIMFrom">and is speaking from : </string>
@@ -66,7 +66,7 @@
<!-- ChangeStatus class -->
<string name="ChangeStatusText">Type here your status message :</string>
<string name="ChangeStatusActTitle">Beem - Change status</string>
- <string name="MenuAddContact">Add new contact</string>
+ <string name="MenuAddContact">Add a new contact</string>
<string name="MenuAccountAbout">Beem Project</string>
<string name="MenuAccountCreate">Create account</string>
<string name="MenuConnection">Edit account</string>
@@ -80,7 +80,7 @@
<string name="SettingsGmail">Check this box if you want to use your Gmail account</string>
<string name="SettingsProxy">Use of a proxy</string>
<string name="SettingsProxySummary">Check this box if you want to use a proxy server</string>
- <string name="SettingsProxyType">protocol of the proxy server</string>
+ <string name="SettingsProxyType">Proxy server type</string>
<string name="SettingsProxyTypeSummary">Allow to choose the proxy server type</string>
<string name="SettingsProxyServer">Address definition of the proxy server</string>
<string name="SettingsProxyPort">Port definition of the proxy server</string>
--- a/src/com/beem/project/beem/service/Contact.java Fri Oct 23 16:26:59 2009 +0200
+++ b/src/com/beem/project/beem/service/Contact.java Fri Oct 23 17:56:58 2009 +0200
@@ -253,8 +253,14 @@
* @param name the mName to set
*/
public void setName(String name) {
- if (name != null)
+ if (name == null || "".equals(name)) {
+ this.mName = this.mJID;
+ this.mName = StringUtils.parseName(this.mName);
+ if (this.mName == null || "".equals(this.mName))
+ this.mName = this.mJID;
+ } else {
this.mName = name;
+ }
}
/**
--- a/src/com/beem/project/beem/ui/ContactList.java Fri Oct 23 16:26:59 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java Fri Oct 23 17:56:58 2009 +0200
@@ -15,7 +15,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
-import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
@@ -561,14 +560,7 @@
}
imgV.setImageDrawable(imageDrawable);
- String mContactName = curContact.getName();
- if (mContactName == null || "".equals(mContactName)) {
- mContactName = curContact.getJID();
- mContactName = StringUtils.parseName(mContactName);
- if ("".equals(mContactName))
- mContactName = curContact.getJID();
- }
- v.setText(mContactName);
+ v.setText(curContact.getName());
v.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
v.setTextColor(Color.WHITE);
v.setTextSize(14);
--- a/src/com/beem/project/beem/ui/SendIM.java Fri Oct 23 16:26:59 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Fri Oct 23 17:56:58 2009 +0200
@@ -64,7 +64,6 @@
private Handler mHandler;
private Contact mContact;
private ImageView mStatusIcon;
- private String mContactName;
private IChatManager mChatManager;
private IChatManagerListener mChatManagerListener;
private IMessageListener mMessageListener;
@@ -316,14 +315,7 @@
if (mRoster.getContact(mContact.getJID()) != null) {
mContact = mRoster.getContact(mContact.getJID());
mStatusText.setText(mContact.getMsgState());
- String contactName = mContact.getName();
- if (contactName == null || "".equals(contactName)) {
- contactName = mContact.getJID();
- contactName = StringUtils.parseName(contactName);
- if (contactName == null || "".equals(contactName))
- contactName = mContact.getJID();
- }
- mLogin.setText(contactName);
+ mLogin.setText(mContact.getName());
}
updateStatusIcon();
}
@@ -386,7 +378,7 @@
mSpeak = 1;
} else {
if (mSpeak != 2)
- mText.append(getString(R.string.SendIMSays, mContactName, message.getBody()));
+ mText.append(getString(R.string.SendIMSays, mContact.getName(), message.getBody()));
else
mText.append(getString(R.string.SendIMSameSpeaker, message.getBody()));
mSpeak = 2;
@@ -531,7 +523,7 @@
} else if (mSpeak == 2)
mText.append(getString(R.string.SendIMSameSpeaker, m.getBody()));
else
- mText.append(getString(R.string.SendIMSays, mContactName, m.getBody()));
+ mText.append(getString(R.string.SendIMSays, mContact.getName(), m.getBody()));
mScrolling.fullScroll(ScrollView.FOCUS_DOWN);
mToSend.requestFocus();
mSpeak = 2;