diff --git a/res/layout/contact_control_row.xml b/res/layout/contact_control_row.xml index ca2291d79..fac6b763a 100644 --- a/res/layout/contact_control_row.xml +++ b/res/layout/contact_control_row.xml @@ -41,7 +41,6 @@ diff --git a/src/org/linphone/ChatMessage.java b/src/org/linphone/ChatMessage.java index b0c59c8cb..7321409bb 100644 --- a/src/org/linphone/ChatMessage.java +++ b/src/org/linphone/ChatMessage.java @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @author Sylvain Berfini + * @deprecated */ public class ChatMessage { private String message; diff --git a/src/org/linphone/LinphoneContact.java b/src/org/linphone/LinphoneContact.java index 6c97b08a2..3987861a7 100644 --- a/src/org/linphone/LinphoneContact.java +++ b/src/org/linphone/LinphoneContact.java @@ -20,6 +20,7 @@ package org.linphone; import java.io.Serializable; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Locale; @@ -64,6 +65,15 @@ public class LinphoneContact implements Serializable, Comparable(); hasSipAddress = false; } + + @Override + public int compareTo(LinphoneContact contact) { + String fullName = getFullName(); + String contactFullName = contact.getFullName(); + String firstLetter = fullName == null || fullName.isEmpty() ? "" : fullName.substring(0, 1).toUpperCase(Locale.getDefault()); + String contactfirstLetter = contactFullName == null || contactFullName.isEmpty() ? "" : contactFullName.substring(0, 1).toUpperCase(Locale.getDefault()); + return firstLetter.compareTo(contactfirstLetter); + } public void setFullName(String name) { fullName = name; @@ -496,8 +506,20 @@ public class LinphoneContact implements Serializable, Comparable { /** * */ @@ -40,6 +40,15 @@ public class LinphoneNumberOrAddress implements Serializable { this(v, isSip); oldValueForUpdatePurpose = old; } + + @Override + public int compareTo(LinphoneNumberOrAddress noa) { + if (noa.isSIPAddress() == isSIPAddress()) { + return noa.getValue().compareTo(getValue()); + } else { + return isSIPAddress() ? -1 : 1; + } + } public boolean isSIPAddress() { return isSIPAddress; diff --git a/submodules/linphone b/submodules/linphone index 7bd469baa..94396dace 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7bd469baa080f657cfe3fd015f58ae32f57dbafc +Subproject commit 94396dacec147c3a223e92a1c8c1da3ff61b127d