mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show the contact nickname at the View screen if available
This commit is contained in:
@ -198,7 +198,11 @@ class ViewContactActivity : ContactActivity() {
|
||||
contact_suffix.text = suffix
|
||||
contact_suffix.beVisibleIf(suffix.isNotEmpty() && showFields and SHOW_SUFFIX_FIELD != 0)
|
||||
|
||||
if (contact_prefix.isGone() && contact_first_name.isGone() && contact_middle_name.isGone() && contact_surname.isGone() && contact_suffix.isGone()) {
|
||||
contact_nickname.text = nickname
|
||||
contact_nickname.beVisibleIf(nickname.isNotEmpty() && showFields and SHOW_NICKNAME_FIELD != 0)
|
||||
|
||||
if (contact_prefix.isGone() && contact_first_name.isGone() && contact_middle_name.isGone() && contact_surname.isGone() && contact_suffix.isGone()
|
||||
&& contact_nickname.isGone()) {
|
||||
contact_name_image.beInvisible()
|
||||
(contact_photo.layoutParams as RelativeLayout.LayoutParams).bottomMargin = resources.getDimension(R.dimen.medium_margin).toInt()
|
||||
}
|
||||
|
@ -240,6 +240,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
||||
(fragment_list.adapter as? ContactsAdapter)?.apply {
|
||||
val filtered = contactsIgnoringSearch.filter {
|
||||
getProperText(it.getFullName(), shouldNormalize).contains(text, true) ||
|
||||
getProperText(it.nickname, shouldNormalize).contains(text, true) ||
|
||||
it.phoneNumbers.any { it.value.contains(text, true) } ||
|
||||
it.emails.any { it.value.contains(text, true) } ||
|
||||
it.addresses.any { getProperText(it.value, shouldNormalize).contains(text, true) } ||
|
||||
|
@ -99,7 +99,7 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m
|
||||
val newEmails = ArrayList<Email>()
|
||||
emails.mapTo(newEmails) { Email(it.value, 0) }
|
||||
|
||||
return copy(id = 0, prefix = "", firstName = getFullName().toLowerCase(), middleName = "", surname = "", suffix = "", photoUri = "",
|
||||
return copy(id = 0, prefix = "", firstName = getFullName().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "",
|
||||
phoneNumbers = newPhoneNumbers, events = ArrayList(), addresses = ArrayList(), emails = newEmails, source = "", starred = 0,
|
||||
contactId = 0, thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", "")).hashCode()
|
||||
}
|
||||
|
Reference in New Issue
Block a user