mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Fixes #343
This commit is contained in:
parent
75d288cbf4
commit
efc3d0f96e
@ -560,7 +560,11 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
|
||||
String headerTitle;
|
||||
|
||||
headerTitle = participant.getName().substring(0, 1).toUpperCase();
|
||||
if (!autocompleteUser.getSource().equals("groups")) {
|
||||
headerTitle = participant.getName().substring(0, 1).toUpperCase();
|
||||
} else {
|
||||
headerTitle = getResources().getString(R.string.nc_groups);
|
||||
}
|
||||
|
||||
GenericTextHeaderItem genericTextHeaderItem;
|
||||
if (!userHeaderItems.containsKey(headerTitle)) {
|
||||
@ -605,6 +609,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
String firstName;
|
||||
String secondName;
|
||||
|
||||
|
||||
if (o1 instanceof UserItem) {
|
||||
firstName = ((UserItem) o1).getModel().getName();
|
||||
} else {
|
||||
@ -617,6 +622,16 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
secondName = ((GenericTextHeaderItem) o2).getModel();
|
||||
}
|
||||
|
||||
if (o1 instanceof UserItem && o2 instanceof UserItem) {
|
||||
if ("groups".equals(((UserItem) o1).getModel().getSource()) && "groups".equals(((UserItem) o2).getModel().getSource())) {
|
||||
return firstName.compareToIgnoreCase(secondName);
|
||||
} else if ("groups".equals(((UserItem) o1).getModel().getSource())) {
|
||||
return -1;
|
||||
} else if ("groups".equals(((UserItem) o2).getModel().getSource())) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return firstName.compareToIgnoreCase(secondName);
|
||||
});
|
||||
|
||||
|
@ -239,5 +239,6 @@ Find Nextcloud on https://nextcloud.com</string>
|
||||
|
||||
<!-- Other -->
|
||||
<string name="nc_limit_hit">1000 characters limit has been hit</string>
|
||||
<string name="nc_groups">Groups</string>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user