diff --git a/CHANGELOG.md b/CHANGELOG.md index eda7e504..5f7e432f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 6.4.1 *(2019-09-16)* +---------------------------- + + * Made duplicate merging more aggressive, compare only by full name + * Fixed some theming and duplicate contact issues at the View details screen + Version 6.4.0 *(2019-09-15)* ---------------------------- diff --git a/app/build.gradle b/app/build.gradle index b8a85159..7cfbd916 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.contacts.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 47 - versionName "6.4.0" + versionCode 48 + versionName "6.4.1" setProperty("archivesBaseName", "contacts") } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt index f92de407..9c437aef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt @@ -572,7 +572,8 @@ class ViewContactActivity : ContactActivity() { ContactsHelper(this).getDuplicatesOfContact(contact!!, false) { contacts -> ensureBackgroundThread { duplicateContacts.clear() - contacts.forEach { + val displayContactSources = getVisibleContactSources() + contacts.filter { displayContactSources.contains(it.source) }.forEach { val duplicate = ContactsHelper(this).getContactWithId(it.id, it.isPrivate()) if (duplicate != null) { duplicateContacts.add(duplicate) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index 3bf36901..7ceffafa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -53,7 +53,7 @@ class ContactsHelper(val context: Context) { val contactsSize = contacts.size() val showOnlyContactsWithNumbers = context.config.showOnlyContactsWithNumbers - var tempContacts = ArrayList(contactsSize) + val tempContacts = ArrayList(contactsSize) val resultContacts = ArrayList(contactsSize) (0 until contactsSize).filter { @@ -67,11 +67,7 @@ class ContactsHelper(val context: Context) { } if (ignoredContactSources.isEmpty() && !getAll) { - tempContacts = tempContacts.distinctBy { - it.getHashToCompare() - } as ArrayList - - tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { "${it.getNameToDisplay().toLowerCase()}${it.emails}" }.values.forEach { it -> + tempContacts.filter { displayContactSources.contains(it.source) }.groupBy { it.getNameToDisplay().toLowerCase()}.values.forEach { it -> if (it.size == 1) { resultContacts.add(it.first()) } else { 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 df352182..8533f942 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 @@ -108,11 +108,8 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m } fun getStringToCompare(): String { - val newEmails = ArrayList() - emails.mapTo(newEmails) { Email(it.value, 0, "") } - return copy(id = 0, prefix = "", firstName = getNameToDisplay().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "", - phoneNumbers = ArrayList(), events = ArrayList(), source = "", addresses = ArrayList(), emails = newEmails, starred = 0, contactId = 0, + phoneNumbers = ArrayList(), emails = ArrayList(), events = ArrayList(), source = "", addresses = ArrayList(), starred = 0, contactId = 0, thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""), IMs = ArrayList()).toString() }