move duplicate checking at View screen in a separate function

This commit is contained in:
tibbi 2019-09-14 22:22:01 +02:00
parent 28ae1eabd3
commit a35e0513be
1 changed files with 5 additions and 2 deletions

View File

@ -205,7 +205,8 @@ class ViewContactActivity : ContactActivity() {
setupOrganization()
setupWebsites()
setupGroups()
addContactSources()
setupContactSources()
checkDuplicateContacts()
}
private fun launchEditContact(contact: Contact) {
@ -473,11 +474,13 @@ class ViewContactActivity : ContactActivity() {
}
}
private fun addContactSources() {
private fun setupContactSources() {
if (contact_sources_holder.childCount == 0) {
addContactSource(contact!!)
}
}
private fun checkDuplicateContacts() {
ContactsHelper(this).getDuplicatesOfContact(contact!!, false) { contacts ->
val currContactSources = contacts.map { it.source }
runOnUiThread {