remove the sorting at fetching, sort just later
This commit is contained in:
parent
9762792388
commit
da12f2f8d6
|
@ -917,18 +917,12 @@ class ContactsHelper(val context: Context) {
|
||||||
|
|
||||||
private fun getSortString(): String {
|
private fun getSortString(): String {
|
||||||
val sorting = context.config.sorting
|
val sorting = context.config.sorting
|
||||||
var sort = when {
|
return when {
|
||||||
sorting and SORT_BY_FIRST_NAME != 0 -> "${CommonDataKinds.StructuredName.GIVEN_NAME} COLLATE NOCASE"
|
sorting and SORT_BY_FIRST_NAME != 0 -> "${CommonDataKinds.StructuredName.GIVEN_NAME} COLLATE NOCASE"
|
||||||
sorting and SORT_BY_MIDDLE_NAME != 0 -> "${CommonDataKinds.StructuredName.MIDDLE_NAME} COLLATE NOCASE"
|
sorting and SORT_BY_MIDDLE_NAME != 0 -> "${CommonDataKinds.StructuredName.MIDDLE_NAME} COLLATE NOCASE"
|
||||||
sorting and SORT_BY_SURNAME != 0 -> "${CommonDataKinds.StructuredName.FAMILY_NAME} COLLATE NOCASE"
|
sorting and SORT_BY_SURNAME != 0 -> "${CommonDataKinds.StructuredName.FAMILY_NAME} COLLATE NOCASE"
|
||||||
else -> CommonDataKinds.Phone.NUMBER
|
else -> CommonDataKinds.Phone.NUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sorting and SORT_DESCENDING != 0) {
|
|
||||||
sort += " DESC"
|
|
||||||
}
|
|
||||||
|
|
||||||
return sort
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRealContactId(id: Long): Int {
|
private fun getRealContactId(id: Long): Int {
|
||||||
|
|
Loading…
Reference in New Issue