Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to generate sorted list of users #31

Closed
mloskot opened this issue Oct 17, 2010 · 1 comment
Closed

Patch to generate sorted list of users #31

mloskot opened this issue Oct 17, 2010 · 1 comment
Labels

Comments

@mloskot
Copy link

mloskot commented Oct 17, 2010

Currently, the list of channel users is not sorted in any way making it difficult to browse and select a user. In my opinion, this list should be sorted alphabetically.

Here is a tiny patch for this fix:

diff --git a/src/org/yaaic/activity/UsersActivity.java b/src/org/yaaic/activity/UsersActivity.java
index 4a527df..5d7aed1 100644
--- a/src/org/yaaic/activity/UsersActivity.java
+++ b/src/org/yaaic/activity/UsersActivity.java
@@ -32,6 +32,8 @@ import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.AdapterView.OnItemClickListener;
 
+import java.util.Arrays;
+
 /**
  * User Activity - Shows a list of users in the current channel
  * 
@@ -51,6 +53,7 @@ public class UsersActivity extends ListActivity implements OnItemClickListener
        setContentView(R.layout.users);
        
        String[] users = getIntent().getExtras().getStringArray(Extra.USERS);
+       Arrays.sort(users, String.CASE_INSENSITIVE_ORDER);
        getListView().setAdapter(new ArrayAdapter(this, R.layout.useritem, users));
        getListView().setOnItemClickListener(this);
    }
@pocmo
Copy link
Owner

pocmo commented Oct 27, 2010

Thanks! I applied your patch in commit 510d396

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants