mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +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;
|
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;
|
GenericTextHeaderItem genericTextHeaderItem;
|
||||||
if (!userHeaderItems.containsKey(headerTitle)) {
|
if (!userHeaderItems.containsKey(headerTitle)) {
|
||||||
@ -605,6 +609,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
String firstName;
|
String firstName;
|
||||||
String secondName;
|
String secondName;
|
||||||
|
|
||||||
|
|
||||||
if (o1 instanceof UserItem) {
|
if (o1 instanceof UserItem) {
|
||||||
firstName = ((UserItem) o1).getModel().getName();
|
firstName = ((UserItem) o1).getModel().getName();
|
||||||
} else {
|
} else {
|
||||||
@ -617,6 +622,16 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
secondName = ((GenericTextHeaderItem) o2).getModel();
|
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);
|
return firstName.compareToIgnoreCase(secondName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -239,5 +239,6 @@ Find Nextcloud on https://nextcloud.com</string>
|
|||||||
|
|
||||||
<!-- Other -->
|
<!-- Other -->
|
||||||
<string name="nc_limit_hit">1000 characters limit has been hit</string>
|
<string name="nc_limit_hit">1000 characters limit has been hit</string>
|
||||||
|
<string name="nc_groups">Groups</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user