Make keylist case insensitive

You want "michael" to be next to "Michael", don't you?
This commit is contained in:
mar-v-in 2014-06-05 00:59:39 +02:00
parent cae0071342
commit dc1e26f39c

View File

@ -253,7 +253,7 @@ public class KeyListFragment extends LoaderFragment
static final int INDEX_HAS_ANY_SECRET = 6;
static final String ORDER =
KeyRings.HAS_ANY_SECRET + " DESC, " + KeyRings.USER_ID + " ASC";
KeyRings.HAS_ANY_SECRET + " DESC, UPPER(" + KeyRings.USER_ID + ") ASC";
@Override
@ -593,7 +593,7 @@ public class KeyListFragment extends LoaderFragment
String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID);
String headerText = convertView.getResources().getString(R.string.user_id_no_name);
if (userId != null && userId.length() > 0) {
headerText = "" + userId.subSequence(0, 1).charAt(0);
headerText = "" + userId.charAt(0);
}
holder.mText.setText(headerText);
holder.mCount.setVisibility(View.GONE);
@ -622,7 +622,7 @@ public class KeyListFragment extends LoaderFragment
// otherwise, return the first character of the name as ID
String userId = mCursor.getString(KeyListFragment.INDEX_USER_ID);
if (userId != null && userId.length() > 0) {
return userId.charAt(0);
return Character.toUpperCase(userId.charAt(0));
} else {
return Long.MAX_VALUE;
}