fix #580, always show middle name after first name

This commit is contained in:
tibbi 2020-07-16 21:46:13 +02:00
parent 234d144d17
commit 484d9c5abd
2 changed files with 4 additions and 7 deletions

View File

@ -93,12 +93,9 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m
}
fun getNameToDisplay(): String {
var firstPart = if (startWithSurname) surname else firstName
if (middleName.isNotEmpty()) {
firstPart += " $middleName"
}
val lastPart = if (startWithSurname) firstName else surname
val firstMiddle = "$firstName $middleName".trim()
val firstPart = if (startWithSurname) surname else firstMiddle
val lastPart = if (startWithSurname) firstMiddle else surname
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
return if (fullName.isEmpty()) {

View File

@ -9,7 +9,7 @@ buildscript {
}
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"
// NOTE: Do not place your application dependencies here; they belong