mirror of
				https://github.com/SimpleMobileTools/Simple-Contacts.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	fix the sorting of organization contacts
This commit is contained in:
		| @@ -16,8 +16,8 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m | ||||
|     } | ||||
|  | ||||
|     override fun compareTo(other: Contact): Int { | ||||
|         val firstString: String | ||||
|         val secondString: String | ||||
|         var firstString: String | ||||
|         var secondString: String | ||||
|  | ||||
|         when { | ||||
|             sorting and SORT_BY_FIRST_NAME != 0 -> { | ||||
| @@ -34,6 +34,14 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (firstString.isEmpty() && firstName.isEmpty() && middleName.isEmpty() && surname.isEmpty() && organization.company.isNotEmpty()) { | ||||
|             firstString = organization.company | ||||
|         } | ||||
|  | ||||
|         if (secondString.isEmpty() && other.firstName.isEmpty() && other.middleName.isEmpty() && other.surname.isEmpty() && other.organization.company.isNotEmpty()) { | ||||
|             secondString = other.organization.company | ||||
|         } | ||||
|  | ||||
|         var result = if (firstString.firstOrNull()?.isLetter() == true && secondString.firstOrNull()?.isLetter() == false) { | ||||
|             -1 | ||||
|         } else if (firstString.firstOrNull()?.isLetter() == false && secondString.firstOrNull()?.isLetter() == true) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user