mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
sort attendee suggestions in a specific order
This commit is contained in:
@ -37,6 +37,14 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: Ar
|
|||||||
resultList.add(it)
|
resultList.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resultList.sortWith(compareBy<Attendee>
|
||||||
|
{ it.name.startsWith(searchString, true) }.thenBy
|
||||||
|
{ it.email.startsWith(searchString, true) }.thenBy
|
||||||
|
{ it.name.contains(searchString, true) }.thenBy
|
||||||
|
{ it.email.contains(searchString, true) })
|
||||||
|
resultList.reverse()
|
||||||
|
|
||||||
filterResults.values = resultList
|
filterResults.values = resultList
|
||||||
filterResults.count = resultList.size
|
filterResults.count = resultList.size
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user