# HG changeset patch # User dasilvj # Date 1256313418 -7200 # Node ID f2f16274b696e2d20836187a50037ad9e8f78f05 # Parent 04e6c855e58ebcdd90dce3a42fbb236cb553a207 - 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. diff -r 04e6c855e58e -r f2f16274b696 res/values-en/strings.xml --- 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 @@ %s says :\n%s\n You say :\n%s\n %s\n - Tip text here + Type your message Is : Error : %s\n and is speaking from : @@ -66,7 +66,7 @@ Type here your status message : Beem - Change status - Add new contact + Add a new contact Beem Project Create account Edit account @@ -80,7 +80,7 @@ Check this box if you want to use your Gmail account Use of a proxy Check this box if you want to use a proxy server - protocol of the proxy server + Proxy server type Allow to choose the proxy server type Address definition of the proxy server Port definition of the proxy server diff -r 04e6c855e58e -r f2f16274b696 src/com/beem/project/beem/service/Contact.java --- 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; + } } /** diff -r 04e6c855e58e -r f2f16274b696 src/com/beem/project/beem/ui/ContactList.java --- 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); diff -r 04e6c855e58e -r f2f16274b696 src/com/beem/project/beem/ui/SendIM.java --- 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;