move duplicate checking at View screen in a separate function
This commit is contained in:
parent
28ae1eabd3
commit
a35e0513be
1 changed files with 5 additions and 2 deletions
|
|
@ -205,7 +205,8 @@ class ViewContactActivity : ContactActivity() {
|
||||||
setupOrganization()
|
setupOrganization()
|
||||||
setupWebsites()
|
setupWebsites()
|
||||||
setupGroups()
|
setupGroups()
|
||||||
addContactSources()
|
setupContactSources()
|
||||||
|
checkDuplicateContacts()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchEditContact(contact: Contact) {
|
private fun launchEditContact(contact: Contact) {
|
||||||
|
|
@ -473,11 +474,13 @@ class ViewContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addContactSources() {
|
private fun setupContactSources() {
|
||||||
if (contact_sources_holder.childCount == 0) {
|
if (contact_sources_holder.childCount == 0) {
|
||||||
addContactSource(contact!!)
|
addContactSource(contact!!)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkDuplicateContacts() {
|
||||||
ContactsHelper(this).getDuplicatesOfContact(contact!!, false) { contacts ->
|
ContactsHelper(this).getDuplicatesOfContact(contact!!, false) { contacts ->
|
||||||
val currContactSources = contacts.map { it.source }
|
val currContactSources = contacts.map { it.source }
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue