mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-23 14:17:17 +02:00
fix #580, always show middle name after first name
This commit is contained in:
parent
234d144d17
commit
484d9c5abd
@ -93,12 +93,9 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getNameToDisplay(): String {
|
fun getNameToDisplay(): String {
|
||||||
var firstPart = if (startWithSurname) surname else firstName
|
val firstMiddle = "$firstName $middleName".trim()
|
||||||
if (middleName.isNotEmpty()) {
|
val firstPart = if (startWithSurname) surname else firstMiddle
|
||||||
firstPart += " $middleName"
|
val lastPart = if (startWithSurname) firstMiddle else surname
|
||||||
}
|
|
||||||
|
|
||||||
val lastPart = if (startWithSurname) firstName else surname
|
|
||||||
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
|
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
|
||||||
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
|
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
|
||||||
return if (fullName.isEmpty()) {
|
return if (fullName.isEmpty()) {
|
||||||
|
@ -9,7 +9,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
Loading…
x
Reference in New Issue
Block a user