aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-02-07 12:29:32 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-02-07 12:29:32 +0100
commitae8c021c16b1b2dca20f4fb385d9afc517f4b935 (patch)
tree443799ed8ccfe9a5b7912ed4c3627fc1bbcafd2c /src/main/java/eu/siacs/conversations
parent00b2e30938a2a185e4c786fc683b60cf47774019 (diff)
sort users in muc
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 399d9fdf..6a8ee024 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -25,6 +25,8 @@ import android.widget.Toast;
import org.openintents.openpgp.util.OpenPgpUtils;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import eu.siacs.conversations.R;
@@ -431,9 +433,16 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
membersView.removeAllViews();
- for (final User user : mConversation.getMucOptions().getUsers()) {
- View view = inflater.inflate(R.layout.contact, membersView,
- false);
+ final ArrayList<User> users = new ArrayList<>();
+ users.addAll(mConversation.getMucOptions().getUsers());
+ Collections.sort(users,new Comparator<User>() {
+ @Override
+ public int compare(User lhs, User rhs) {
+ return lhs.getName().compareToIgnoreCase(rhs.getName());
+ }
+ });
+ for (final User user : users) {
+ View view = inflater.inflate(R.layout.contact, membersView,false);
this.setListItemBackgroundOnView(view);
view.setOnClickListener(new OnClickListener() {
@Override