diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt index 9ae4245a..83e0ff17 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt @@ -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()) { diff --git a/build.gradle b/build.gradle index d11fae6a..7c6d8857 100644 --- a/build.gradle +++ b/build.gradle @@ -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