mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-18 12:30:38 +01:00
move names not starting with a letter at the bottom
This commit is contained in:
parent
771ecd5ec4
commit
9a376df115
@ -64,6 +64,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contacts_fastscroller.updateBubbleColors()
|
contacts_fastscroller.updateBubbleColors()
|
||||||
|
contacts_fastscroller.allowBubbleDisplay = config.showInfoBubble
|
||||||
updateTextColors(contacts_holder)
|
updateTextColors(contacts_holder)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +128,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
contacts_list.adapter = this
|
contacts_list.adapter = this
|
||||||
}
|
}
|
||||||
|
|
||||||
contacts_fastscroller.allowBubbleDisplay = config.showInfoBubble
|
|
||||||
contacts_fastscroller.setViews(contacts_list) {
|
contacts_fastscroller.setViews(contacts_list) {
|
||||||
val item = contacts.getOrNull(it)
|
val item = contacts.getOrNull(it)
|
||||||
contacts_fastscroller.updateBubbleText(item?.getBubbleText() ?: "")
|
contacts_fastscroller.updateBubbleText(item?.getBubbleText() ?: "")
|
||||||
|
@ -11,7 +11,13 @@ data class Contact(val id: Int, var name: String, var number: String, var photoU
|
|||||||
override fun compareTo(other: Contact): Int {
|
override fun compareTo(other: Contact): Int {
|
||||||
var result = when {
|
var result = when {
|
||||||
(sorting and SORT_BY_NUMBER != 0) -> number.toLowerCase().compareTo(other.number.toLowerCase())
|
(sorting and SORT_BY_NUMBER != 0) -> number.toLowerCase().compareTo(other.number.toLowerCase())
|
||||||
else -> name.toLowerCase().compareTo(other.name.toLowerCase())
|
else -> if (name.first().isLetter() && !other.name.first().isLetter()) {
|
||||||
|
-1
|
||||||
|
} else if (!name.first().isLetter() && other.name.first().isLetter()) {
|
||||||
|
1
|
||||||
|
} else {
|
||||||
|
name.toLowerCase().compareTo(other.name.toLowerCase())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sorting and SORT_DESCENDING != 0) {
|
if (sorting and SORT_DESCENDING != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user