mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show all contact sources of a given contact at View screen
This commit is contained in:
@ -113,6 +113,17 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
|
|
||||||
if (contactId != 0 && !wasLookupKeyUsed) {
|
if (contactId != 0 && !wasLookupKeyUsed) {
|
||||||
contact = ContactsHelper(this).getContactWithId(contactId, intent.getBooleanExtra(IS_PRIVATE, false))
|
contact = ContactsHelper(this).getContactWithId(contactId, intent.getBooleanExtra(IS_PRIVATE, false))
|
||||||
|
|
||||||
|
if (contact != null) {
|
||||||
|
ContactsHelper(this).getContacts { contacts ->
|
||||||
|
contacts.forEach {
|
||||||
|
if (it.id != contact!!.id && it.getHashToCompare() == contact!!.getHashToCompare()) {
|
||||||
|
addContactSource(it.source)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (contact == null) {
|
if (contact == null) {
|
||||||
if (!wasEditLaunched) {
|
if (!wasEditLaunched) {
|
||||||
toast(R.string.unknown_error_occurred)
|
toast(R.string.unknown_error_occurred)
|
||||||
@ -201,7 +212,7 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
setupOrganization()
|
setupOrganization()
|
||||||
setupWebsites()
|
setupWebsites()
|
||||||
setupGroups()
|
setupGroups()
|
||||||
setupContactSource(contact!!.source)
|
addContactSource(contact!!.source)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun editContact() {
|
private fun editContact() {
|
||||||
@ -469,7 +480,7 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupContactSource(source: String) {
|
private fun addContactSource(source: String) {
|
||||||
if (showFields and SHOW_CONTACT_SOURCE_FIELD != 0) {
|
if (showFields and SHOW_CONTACT_SOURCE_FIELD != 0) {
|
||||||
layoutInflater.inflate(R.layout.item_view_contact_source, contact_sources_holder, false).apply {
|
layoutInflater.inflate(R.layout.item_view_contact_source, contact_sources_holder, false).apply {
|
||||||
getPublicContactSource(source) {
|
getPublicContactSource(source) {
|
||||||
|
@ -112,7 +112,7 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m
|
|||||||
emails.mapTo(newEmails) { Email(it.value, 0, "") }
|
emails.mapTo(newEmails) { Email(it.value, 0, "") }
|
||||||
|
|
||||||
return copy(id = 0, prefix = "", firstName = getNameToDisplay().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "",
|
return copy(id = 0, prefix = "", firstName = getNameToDisplay().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "",
|
||||||
phoneNumbers = ArrayList(), events = ArrayList(), addresses = ArrayList(), emails = newEmails, starred = 0, contactId = 0,
|
phoneNumbers = ArrayList(), events = ArrayList(), source = "", addresses = ArrayList(), emails = newEmails, starred = 0, contactId = 0,
|
||||||
thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""), IMs = ArrayList()).toString()
|
thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""), IMs = ArrayList()).toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user