diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt index 00758fce..d6c4207e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt @@ -52,6 +52,7 @@ class NewMessageActivity : SimpleActivity() { } } + filteredContacts.sortWith(compareBy { !it.name.startsWith(searchString, true) }) setupAdapter(filteredContacts) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/AutoCompleteTextViewAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/AutoCompleteTextViewAdapter.kt index 5da58854..33ac74fa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/AutoCompleteTextViewAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/AutoCompleteTextViewAdapter.kt @@ -54,10 +54,7 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: Ar } } - resultList.sortWith(compareBy - { it.name.startsWith(searchString, true) }.thenBy - { it.name.contains(searchString, true) }) - resultList.reverse() + resultList.sortWith(compareBy { !it.name.startsWith(searchString, true) }) filterResults.values = resultList filterResults.count = resultList.size