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.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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue