mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-15 03:10:59 +01:00
sort attendee suggestions in a specific order
This commit is contained in:
parent
62bea960e3
commit
aca2f1b163
@ -37,6 +37,14 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: Ar
|
||||
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.count = resultList.size
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user