Fixed display issue in contacts' search list in chatfragment
This commit is contained in:
parent
b7c21b57f1
commit
fbac8c01cd
1 changed files with 10 additions and 4 deletions
|
@ -1026,7 +1026,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
if(search != null) {
|
if(search != null) {
|
||||||
for (ContactAddress c : searchAdapter.contacts) {
|
for (ContactAddress c : searchAdapter.contacts) {
|
||||||
String address = c.address;
|
String address = c.address;
|
||||||
if(address.startsWith("sip:")) address = address.substring(4);
|
if (address.startsWith("sip:")) address = address.substring(4);
|
||||||
if (c.contact.getFullName().toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))
|
if (c.contact.getFullName().toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))
|
||||||
|| address.toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))) {
|
|| address.toLowerCase(Locale.getDefault()).startsWith(search.toLowerCase(Locale.getDefault()))) {
|
||||||
result.add(c);
|
result.add(c);
|
||||||
|
@ -1044,7 +1044,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
|
|
||||||
SearchContactsListAdapter(List<ContactAddress> contactsList) {
|
SearchContactsListAdapter(List<ContactAddress> contactsList) {
|
||||||
mInflater = inflater;
|
mInflater = inflater;
|
||||||
if(contactsList == null){
|
if (contactsList == null) {
|
||||||
contacts = getContactsList();
|
contacts = getContactsList();
|
||||||
} else {
|
} else {
|
||||||
contacts = contactsList;
|
contacts = contactsList;
|
||||||
|
@ -1056,7 +1056,13 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
if(ContactsManager.getInstance().hasContacts()) {
|
if(ContactsManager.getInstance().hasContacts()) {
|
||||||
for (LinphoneContact con : ContactsManager.getInstance().getContacts()) {
|
for (LinphoneContact con : ContactsManager.getInstance().getContacts()) {
|
||||||
for (LinphoneNumberOrAddress noa : con.getNumbersOrAddresses()) {
|
for (LinphoneNumberOrAddress noa : con.getNumbersOrAddresses()) {
|
||||||
list.add(new ContactAddress(con, noa.getValue()));
|
String value = noa.getValue();
|
||||||
|
// Fix for sip:username compatibility issue
|
||||||
|
if (value.startsWith("sip:") && !value.contains("@")) {
|
||||||
|
value = value.substring(4);
|
||||||
|
value = LinphoneUtils.getFullAddressFromUsername(value);
|
||||||
|
}
|
||||||
|
list.add(new ContactAddress(con, value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1094,7 +1100,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
}
|
}
|
||||||
|
|
||||||
final String a = contact.address;
|
final String a = contact.address;
|
||||||
final LinphoneContact c = contact.contact;
|
LinphoneContact c = contact.contact;
|
||||||
|
|
||||||
TextView name = (TextView) view.findViewById(R.id.contact_name);
|
TextView name = (TextView) view.findViewById(R.id.contact_name);
|
||||||
name.setText(c.getFullName());
|
name.setText(c.getFullName());
|
||||||
|
|
Loading…
Reference in a new issue