make sure only the proper fields are shown at Edit Contact screen
This commit is contained in:
parent
d94dbde48e
commit
510da6b140
|
@ -170,24 +170,24 @@ class EditContactActivity : ContactActivity() {
|
||||||
contact_start_call.applyColorFilter(textColor)
|
contact_start_call.applyColorFilter(textColor)
|
||||||
contact_send_email.applyColorFilter(textColor)
|
contact_send_email.applyColorFilter(textColor)
|
||||||
contact_name_image.applyColorFilter(textColor)
|
contact_name_image.applyColorFilter(textColor)
|
||||||
contact_number_image.applyColorFilter(textColor)
|
contact_numbers_image.applyColorFilter(textColor)
|
||||||
contact_email_image.applyColorFilter(textColor)
|
contact_emails_image.applyColorFilter(textColor)
|
||||||
contact_address_image.applyColorFilter(textColor)
|
contact_addresses_image.applyColorFilter(textColor)
|
||||||
contact_event_image.applyColorFilter(textColor)
|
contact_events_image.applyColorFilter(textColor)
|
||||||
contact_notes_image.applyColorFilter(textColor)
|
contact_notes_image.applyColorFilter(textColor)
|
||||||
contact_source_image.applyColorFilter(textColor)
|
contact_source_image.applyColorFilter(textColor)
|
||||||
contact_groups_image.applyColorFilter(textColor)
|
contact_groups_image.applyColorFilter(textColor)
|
||||||
contact_organization_image.applyColorFilter(textColor)
|
contact_organization_image.applyColorFilter(textColor)
|
||||||
|
|
||||||
val adjustedPrimaryColor = getAdjustedPrimaryColor()
|
val adjustedPrimaryColor = getAdjustedPrimaryColor()
|
||||||
contact_number_add_new.applyColorFilter(adjustedPrimaryColor)
|
contact_numbers_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||||
contact_number_add_new.background.applyColorFilter(textColor)
|
contact_numbers_add_new.background.applyColorFilter(textColor)
|
||||||
contact_email_add_new.applyColorFilter(adjustedPrimaryColor)
|
contact_emails_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||||
contact_email_add_new.background.applyColorFilter(textColor)
|
contact_emails_add_new.background.applyColorFilter(textColor)
|
||||||
contact_address_add_new.applyColorFilter(adjustedPrimaryColor)
|
contact_addresses_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||||
contact_address_add_new.background.applyColorFilter(textColor)
|
contact_addresses_add_new.background.applyColorFilter(textColor)
|
||||||
contact_event_add_new.applyColorFilter(adjustedPrimaryColor)
|
contact_events_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||||
contact_event_add_new.background.applyColorFilter(textColor)
|
contact_events_add_new.background.applyColorFilter(textColor)
|
||||||
contact_groups_add_new.applyColorFilter(adjustedPrimaryColor)
|
contact_groups_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||||
contact_groups_add_new.background.applyColorFilter(textColor)
|
contact_groups_add_new.background.applyColorFilter(textColor)
|
||||||
|
|
||||||
|
@ -196,12 +196,14 @@ class EditContactActivity : ContactActivity() {
|
||||||
contact_send_sms.setOnClickListener { trySendSMS() }
|
contact_send_sms.setOnClickListener { trySendSMS() }
|
||||||
contact_start_call.setOnClickListener { tryStartCall(contact!!) }
|
contact_start_call.setOnClickListener { tryStartCall(contact!!) }
|
||||||
contact_send_email.setOnClickListener { trySendEmail() }
|
contact_send_email.setOnClickListener { trySendEmail() }
|
||||||
contact_number_add_new.setOnClickListener { addNewPhoneNumberField() }
|
contact_numbers_add_new.setOnClickListener { addNewPhoneNumberField() }
|
||||||
contact_email_add_new.setOnClickListener { addNewEmailField() }
|
contact_emails_add_new.setOnClickListener { addNewEmailField() }
|
||||||
contact_address_add_new.setOnClickListener { addNewAddressField() }
|
contact_addresses_add_new.setOnClickListener { addNewAddressField() }
|
||||||
contact_event_add_new.setOnClickListener { addNewEventField() }
|
contact_events_add_new.setOnClickListener { addNewEventField() }
|
||||||
contact_groups_add_new.setOnClickListener { showSelectGroupsDialog() }
|
contact_groups_add_new.setOnClickListener { showSelectGroupsDialog() }
|
||||||
|
|
||||||
|
setupFieldVisibility()
|
||||||
|
|
||||||
contact_toggle_favorite.apply {
|
contact_toggle_favorite.apply {
|
||||||
setImageDrawable(getStarDrawable(contact!!.starred == 1))
|
setImageDrawable(getStarDrawable(contact!!.starred == 1))
|
||||||
tag = contact!!.starred
|
tag = contact!!.starred
|
||||||
|
@ -240,6 +242,55 @@ class EditContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupFieldVisibility() {
|
||||||
|
if (showFields and (SHOW_PREFIX_FIELD or SHOW_FIRST_NAME_FIELD or SHOW_MIDDLE_NAME_FIELD or SHOW_SURNAME_FIELD or SHOW_SUFFIX_FIELD) == 0) {
|
||||||
|
contact_name_image.beInvisible()
|
||||||
|
}
|
||||||
|
|
||||||
|
contact_prefix.beVisibleIf(showFields and SHOW_PREFIX_FIELD != 0)
|
||||||
|
contact_first_name.beVisibleIf(showFields and SHOW_FIRST_NAME_FIELD != 0)
|
||||||
|
contact_middle_name.beVisibleIf(showFields and SHOW_MIDDLE_NAME_FIELD != 0)
|
||||||
|
contact_surname.beVisibleIf(showFields and SHOW_SURNAME_FIELD != 0)
|
||||||
|
contact_suffix.beVisibleIf(showFields and SHOW_SUFFIX_FIELD != 0)
|
||||||
|
|
||||||
|
contact_source.beVisibleIf(showFields and SHOW_CONTACT_SOURCE_FIELD != 0)
|
||||||
|
contact_source_image.beVisibleIf(showFields and SHOW_CONTACT_SOURCE_FIELD != 0)
|
||||||
|
|
||||||
|
val arePhoneNumbersVisible = showFields and SHOW_PHONE_NUMBERS_FIELD != 0
|
||||||
|
contact_numbers_image.beVisibleIf(arePhoneNumbersVisible)
|
||||||
|
contact_numbers_holder.beVisibleIf(arePhoneNumbersVisible)
|
||||||
|
contact_numbers_add_new.beVisibleIf(arePhoneNumbersVisible)
|
||||||
|
|
||||||
|
val areEmailsVisible = showFields and SHOW_EMAILS_FIELD != 0
|
||||||
|
contact_emails_image.beVisibleIf(areEmailsVisible)
|
||||||
|
contact_emails_holder.beVisibleIf(areEmailsVisible)
|
||||||
|
contact_emails_add_new.beVisibleIf(areEmailsVisible)
|
||||||
|
|
||||||
|
val areAddressesVisible = showFields and SHOW_ADDRESSES_FIELD != 0
|
||||||
|
contact_addresses_image.beVisibleIf(areAddressesVisible)
|
||||||
|
contact_addresses_holder.beVisibleIf(areAddressesVisible)
|
||||||
|
contact_addresses_add_new.beVisibleIf(areAddressesVisible)
|
||||||
|
|
||||||
|
val isOrganizationVisible = showFields and SHOW_ORGANIZATION_FIELD != 0
|
||||||
|
contact_organization_company.beVisibleIf(isOrganizationVisible)
|
||||||
|
contact_organization_job_position.beVisibleIf(isOrganizationVisible)
|
||||||
|
contact_organization_image.beVisibleIf(isOrganizationVisible)
|
||||||
|
|
||||||
|
val areEventsVisible = showFields and SHOW_EVENTS_FIELD != 0
|
||||||
|
contact_events_image.beVisibleIf(areEventsVisible)
|
||||||
|
contact_events_holder.beVisibleIf(areEventsVisible)
|
||||||
|
contact_events_add_new.beVisibleIf(areEventsVisible)
|
||||||
|
|
||||||
|
val areGroupsVisible = showFields and SHOW_GROUPS_FIELD != 0
|
||||||
|
contact_groups_image.beVisibleIf(areGroupsVisible)
|
||||||
|
contact_groups_holder.beVisibleIf(areGroupsVisible)
|
||||||
|
contact_groups_add_new.beVisibleIf(areGroupsVisible)
|
||||||
|
|
||||||
|
val areNotesVisible = showFields and SHOW_NOTES_FIELD != 0
|
||||||
|
contact_notes.beVisibleIf(areNotesVisible)
|
||||||
|
contact_notes_image.beVisibleIf(areNotesVisible)
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupEditContact() {
|
private fun setupEditContact() {
|
||||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
||||||
supportActionBar?.title = resources.getString(R.string.edit_contact)
|
supportActionBar?.title = resources.getString(R.string.edit_contact)
|
||||||
|
@ -248,6 +299,7 @@ class EditContactActivity : ContactActivity() {
|
||||||
contact_middle_name.setText(contact!!.middleName)
|
contact_middle_name.setText(contact!!.middleName)
|
||||||
contact_surname.setText(contact!!.surname)
|
contact_surname.setText(contact!!.surname)
|
||||||
contact_suffix.setText(contact!!.suffix)
|
contact_suffix.setText(contact!!.suffix)
|
||||||
|
|
||||||
contact_source.text = getPublicContactSource(contact!!.source)
|
contact_source.text = getPublicContactSource(contact!!.source)
|
||||||
|
|
||||||
setupPhoneNumbers()
|
setupPhoneNumbers()
|
||||||
|
@ -260,82 +312,94 @@ class EditContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupPhoneNumbers() {
|
private fun setupPhoneNumbers() {
|
||||||
contact!!.phoneNumbers.forEachIndexed { index, number ->
|
if (showFields and SHOW_PHONE_NUMBERS_FIELD != 0) {
|
||||||
var numberHolder = contact_numbers_holder.getChildAt(index)
|
contact!!.phoneNumbers.forEachIndexed { index, number ->
|
||||||
if (numberHolder == null) {
|
var numberHolder = contact_numbers_holder.getChildAt(index)
|
||||||
numberHolder = layoutInflater.inflate(R.layout.item_edit_phone_number, contact_numbers_holder, false)
|
if (numberHolder == null) {
|
||||||
contact_numbers_holder.addView(numberHolder)
|
numberHolder = layoutInflater.inflate(R.layout.item_edit_phone_number, contact_numbers_holder, false)
|
||||||
}
|
contact_numbers_holder.addView(numberHolder)
|
||||||
|
}
|
||||||
|
|
||||||
numberHolder!!.apply {
|
numberHolder!!.apply {
|
||||||
contact_number.setText(number.value)
|
contact_number.setText(number.value)
|
||||||
setupPhoneNumberTypePicker(contact_number_type, number.type)
|
setupPhoneNumberTypePicker(contact_number_type, number.type)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupEmails() {
|
private fun setupEmails() {
|
||||||
contact!!.emails.forEachIndexed { index, email ->
|
if (showFields and SHOW_EMAILS_FIELD != 0) {
|
||||||
var emailHolder = contact_emails_holder.getChildAt(index)
|
contact!!.emails.forEachIndexed { index, email ->
|
||||||
if (emailHolder == null) {
|
var emailHolder = contact_emails_holder.getChildAt(index)
|
||||||
emailHolder = layoutInflater.inflate(R.layout.item_edit_email, contact_emails_holder, false)
|
if (emailHolder == null) {
|
||||||
contact_emails_holder.addView(emailHolder)
|
emailHolder = layoutInflater.inflate(R.layout.item_edit_email, contact_emails_holder, false)
|
||||||
}
|
contact_emails_holder.addView(emailHolder)
|
||||||
|
}
|
||||||
|
|
||||||
emailHolder!!.apply {
|
emailHolder!!.apply {
|
||||||
contact_email.setText(email.value)
|
contact_email.setText(email.value)
|
||||||
setupEmailTypePicker(contact_email_type, email.type)
|
setupEmailTypePicker(contact_email_type, email.type)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupAddresses() {
|
private fun setupAddresses() {
|
||||||
contact!!.addresses.forEachIndexed { index, address ->
|
if (showFields and SHOW_ADDRESSES_FIELD != 0) {
|
||||||
var addressHolder = contact_addresses_holder.getChildAt(index)
|
contact!!.addresses.forEachIndexed { index, address ->
|
||||||
if (addressHolder == null) {
|
var addressHolder = contact_addresses_holder.getChildAt(index)
|
||||||
addressHolder = layoutInflater.inflate(R.layout.item_edit_address, contact_addresses_holder, false)
|
if (addressHolder == null) {
|
||||||
contact_addresses_holder.addView(addressHolder)
|
addressHolder = layoutInflater.inflate(R.layout.item_edit_address, contact_addresses_holder, false)
|
||||||
}
|
contact_addresses_holder.addView(addressHolder)
|
||||||
|
}
|
||||||
|
|
||||||
addressHolder!!.apply {
|
addressHolder!!.apply {
|
||||||
contact_address.setText(address.value)
|
contact_address.setText(address.value)
|
||||||
setupAddressTypePicker(contact_address_type, address.type)
|
setupAddressTypePicker(contact_address_type, address.type)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNotes() {
|
private fun setupNotes() {
|
||||||
contact_notes.setText(contact!!.notes)
|
if (showFields and SHOW_NOTES_FIELD != 0) {
|
||||||
|
contact_notes.setText(contact!!.notes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupOrganization() {
|
private fun setupOrganization() {
|
||||||
contact_organization_company.setText(contact!!.organization.company)
|
if (showFields and SHOW_ORGANIZATION_FIELD != 0) {
|
||||||
contact_organization_job_position.setText(contact!!.organization.jobPosition)
|
contact_organization_company.setText(contact!!.organization.company)
|
||||||
|
contact_organization_job_position.setText(contact!!.organization.jobPosition)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupEvents() {
|
private fun setupEvents() {
|
||||||
contact!!.events.forEachIndexed { index, event ->
|
if (showFields and SHOW_EVENTS_FIELD != 0) {
|
||||||
var eventHolder = contact_events_holder.getChildAt(index)
|
contact!!.events.forEachIndexed { index, event ->
|
||||||
if (eventHolder == null) {
|
var eventHolder = contact_events_holder.getChildAt(index)
|
||||||
eventHolder = layoutInflater.inflate(R.layout.item_event, contact_events_holder, false)
|
if (eventHolder == null) {
|
||||||
contact_events_holder.addView(eventHolder)
|
eventHolder = layoutInflater.inflate(R.layout.item_event, contact_events_holder, false)
|
||||||
}
|
contact_events_holder.addView(eventHolder)
|
||||||
|
|
||||||
(eventHolder as ViewGroup).apply {
|
|
||||||
val contactEvent = contact_event.apply {
|
|
||||||
getDateTime(event.value, this)
|
|
||||||
tag = event.value
|
|
||||||
alpha = 1f
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setupEventTypePicker(this, event.type)
|
(eventHolder as ViewGroup).apply {
|
||||||
|
val contactEvent = contact_event.apply {
|
||||||
|
getDateTime(event.value, this)
|
||||||
|
tag = event.value
|
||||||
|
alpha = 1f
|
||||||
|
}
|
||||||
|
|
||||||
contact_event_remove.apply {
|
setupEventTypePicker(this, event.type)
|
||||||
beVisible()
|
|
||||||
applyColorFilter(getAdjustedPrimaryColor())
|
contact_event_remove.apply {
|
||||||
background.applyColorFilter(config.textColor)
|
beVisible()
|
||||||
setOnClickListener {
|
applyColorFilter(getAdjustedPrimaryColor())
|
||||||
resetContactEvent(contactEvent, this)
|
background.applyColorFilter(config.textColor)
|
||||||
|
setOnClickListener {
|
||||||
|
resetContactEvent(contactEvent, this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -343,57 +407,59 @@ class EditContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupGroups() {
|
private fun setupGroups() {
|
||||||
contact_groups_holder.removeAllViews()
|
if (showFields and SHOW_GROUPS_FIELD != 0) {
|
||||||
val groups = contact!!.groups
|
contact_groups_holder.removeAllViews()
|
||||||
groups.forEachIndexed { index, group ->
|
val groups = contact!!.groups
|
||||||
var groupHolder = contact_groups_holder.getChildAt(index)
|
groups.forEachIndexed { index, group ->
|
||||||
if (groupHolder == null) {
|
var groupHolder = contact_groups_holder.getChildAt(index)
|
||||||
groupHolder = layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false)
|
if (groupHolder == null) {
|
||||||
contact_groups_holder.addView(groupHolder)
|
groupHolder = layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false)
|
||||||
}
|
contact_groups_holder.addView(groupHolder)
|
||||||
|
|
||||||
(groupHolder as ViewGroup).apply {
|
|
||||||
contact_group.apply {
|
|
||||||
text = group.title
|
|
||||||
setTextColor(config.textColor)
|
|
||||||
tag = group.id
|
|
||||||
alpha = 1f
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOnClickListener {
|
(groupHolder as ViewGroup).apply {
|
||||||
showSelectGroupsDialog()
|
contact_group.apply {
|
||||||
}
|
text = group.title
|
||||||
|
setTextColor(config.textColor)
|
||||||
|
tag = group.id
|
||||||
|
alpha = 1f
|
||||||
|
}
|
||||||
|
|
||||||
contact_group_remove.apply {
|
|
||||||
beVisible()
|
|
||||||
applyColorFilter(getAdjustedPrimaryColor())
|
|
||||||
background.applyColorFilter(config.textColor)
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
removeGroup(group.id)
|
showSelectGroupsDialog()
|
||||||
|
}
|
||||||
|
|
||||||
|
contact_group_remove.apply {
|
||||||
|
beVisible()
|
||||||
|
applyColorFilter(getAdjustedPrimaryColor())
|
||||||
|
background.applyColorFilter(config.textColor)
|
||||||
|
setOnClickListener {
|
||||||
|
removeGroup(group.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false).apply {
|
layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false).apply {
|
||||||
contact_group.apply {
|
contact_group.apply {
|
||||||
alpha = 0.5f
|
alpha = 0.5f
|
||||||
text = getString(R.string.no_groups)
|
text = getString(R.string.no_groups)
|
||||||
setTextColor(config.textColor)
|
setTextColor(config.textColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
contact_groups_holder.addView(this)
|
contact_groups_holder.addView(this)
|
||||||
contact_group_remove.beGone()
|
contact_group_remove.beGone()
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
showSelectGroupsDialog()
|
showSelectGroupsDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNewContact() {
|
private fun setupNewContact() {
|
||||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
|
//window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
|
||||||
supportActionBar?.title = resources.getString(R.string.new_contact)
|
supportActionBar?.title = resources.getString(R.string.new_contact)
|
||||||
val contactSource = if (hasContactPermissions()) config.lastUsedContactSource else SMT_PRIVATE
|
val contactSource = if (hasContactPermissions()) config.lastUsedContactSource else SMT_PRIVATE
|
||||||
val organization = Organization("", "")
|
val organization = Organization("", "")
|
||||||
|
|
|
@ -118,9 +118,9 @@ class ViewContactActivity : ContactActivity() {
|
||||||
contact_start_call.applyColorFilter(textColor)
|
contact_start_call.applyColorFilter(textColor)
|
||||||
contact_send_email.applyColorFilter(textColor)
|
contact_send_email.applyColorFilter(textColor)
|
||||||
contact_name_image.applyColorFilter(textColor)
|
contact_name_image.applyColorFilter(textColor)
|
||||||
contact_number_image.applyColorFilter(textColor)
|
contact_numbers_image.applyColorFilter(textColor)
|
||||||
contact_email_image.applyColorFilter(textColor)
|
contact_emails_image.applyColorFilter(textColor)
|
||||||
contact_event_image.applyColorFilter(textColor)
|
contact_events_image.applyColorFilter(textColor)
|
||||||
contact_source_image.applyColorFilter(textColor)
|
contact_source_image.applyColorFilter(textColor)
|
||||||
contact_notes_image.applyColorFilter(textColor)
|
contact_notes_image.applyColorFilter(textColor)
|
||||||
contact_organization_image.applyColorFilter(textColor)
|
contact_organization_image.applyColorFilter(textColor)
|
||||||
|
@ -199,10 +199,10 @@ class ViewContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contact_number_image.beVisible()
|
contact_numbers_image.beVisible()
|
||||||
contact_numbers_holder.beVisible()
|
contact_numbers_holder.beVisible()
|
||||||
} else {
|
} else {
|
||||||
contact_number_image.beGone()
|
contact_numbers_image.beGone()
|
||||||
contact_numbers_holder.beGone()
|
contact_numbers_holder.beGone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,10 +223,10 @@ class ViewContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contact_email_image.beVisible()
|
contact_emails_image.beVisible()
|
||||||
contact_emails_holder.beVisible()
|
contact_emails_holder.beVisible()
|
||||||
} else {
|
} else {
|
||||||
contact_email_image.beGone()
|
contact_emails_image.beGone()
|
||||||
contact_emails_holder.beGone()
|
contact_emails_holder.beGone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,10 +247,10 @@ class ViewContactActivity : ContactActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contact_address_image.beVisible()
|
contact_addresses_image.beVisible()
|
||||||
contact_addresses_holder.beVisible()
|
contact_addresses_holder.beVisible()
|
||||||
} else {
|
} else {
|
||||||
contact_address_image.beGone()
|
contact_addresses_image.beGone()
|
||||||
contact_addresses_holder.beGone()
|
contact_addresses_holder.beGone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,10 +268,10 @@ class ViewContactActivity : ContactActivity() {
|
||||||
contact_event_remove.beGone()
|
contact_event_remove.beGone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contact_event_image.beVisible()
|
contact_events_image.beVisible()
|
||||||
contact_events_holder.beVisible()
|
contact_events_holder.beVisible()
|
||||||
} else {
|
} else {
|
||||||
contact_event_image.beGone()
|
contact_events_image.beGone()
|
||||||
contact_events_holder.beGone()
|
contact_events_holder.beGone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_photo"
|
android:layout_below="@+id/contact_photo"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginBottom="@dimen/normal_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:hint="@string/prefix"
|
android:hint="@string/prefix"
|
||||||
android:inputType="textCapWords"
|
android:inputType="textCapWords"
|
||||||
|
@ -111,7 +112,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_prefix"
|
android:layout_below="@+id/contact_prefix"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
android:layout_marginBottom="@dimen/normal_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:hint="@string/first_name"
|
android:hint="@string/first_name"
|
||||||
android:inputType="textCapWords"
|
android:inputType="textCapWords"
|
||||||
|
@ -127,7 +128,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_first_name"
|
android:layout_below="@+id/contact_first_name"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
android:layout_marginBottom="@dimen/normal_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:hint="@string/middle_name"
|
android:hint="@string/middle_name"
|
||||||
android:inputType="textCapWords"
|
android:inputType="textCapWords"
|
||||||
|
@ -143,7 +144,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_middle_name"
|
android:layout_below="@+id/contact_middle_name"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
android:layout_marginBottom="@dimen/normal_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:hint="@string/surname"
|
android:hint="@string/surname"
|
||||||
android:inputType="textCapWords"
|
android:inputType="textCapWords"
|
||||||
|
@ -159,7 +160,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_surname"
|
android:layout_below="@+id/contact_surname"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:hint="@string/suffix"
|
android:hint="@string/suffix"
|
||||||
android:inputType="textCapWords"
|
android:inputType="textCapWords"
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
android:textSize="@dimen/bigger_text_size"/>
|
android:textSize="@dimen/bigger_text_size"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_number_image"
|
android:id="@+id/contact_numbers_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_numbers_holder"
|
android:layout_alignTop="@+id/contact_numbers_holder"
|
||||||
|
@ -185,8 +186,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_suffix"
|
android:layout_below="@+id/contact_suffix"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginBottom="@dimen/small_margin"
|
||||||
android:layout_toRightOf="@+id/contact_number_image"
|
android:layout_toRightOf="@+id/contact_numbers_image"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include layout="@layout/item_edit_phone_number"/>
|
<include layout="@layout/item_edit_phone_number"/>
|
||||||
|
@ -194,21 +195,21 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_number_add_new"
|
android:id="@+id/contact_numbers_add_new"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_numbers_holder"
|
android:layout_below="@+id/contact_numbers_holder"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="@dimen/small_margin"
|
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
android:paddingBottom="@dimen/medium_margin"
|
android:paddingBottom="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/activity_margin"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
android:paddingTop="@dimen/medium_margin"
|
android:paddingTop="@dimen/medium_margin"
|
||||||
android:src="@drawable/ic_plus"/>
|
android:src="@drawable/ic_plus"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_email_image"
|
android:id="@+id/contact_emails_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_emails_holder"
|
android:layout_alignTop="@+id/contact_emails_holder"
|
||||||
|
@ -222,8 +223,7 @@
|
||||||
android:id="@+id/contact_emails_holder"
|
android:id="@+id/contact_emails_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_number_add_new"
|
android:layout_below="@+id/contact_numbers_add_new"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_email_add_new"
|
android:id="@+id/contact_emails_add_new"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_emails_holder"
|
android:layout_below="@+id/contact_emails_holder"
|
||||||
|
@ -246,7 +246,7 @@
|
||||||
android:src="@drawable/ic_plus"/>
|
android:src="@drawable/ic_plus"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_address_image"
|
android:id="@+id/contact_addresses_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_addresses_holder"
|
android:layout_alignTop="@+id/contact_addresses_holder"
|
||||||
|
@ -260,7 +260,7 @@
|
||||||
android:id="@+id/contact_addresses_holder"
|
android:id="@+id/contact_addresses_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_email_add_new"
|
android:layout_below="@+id/contact_emails_add_new"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -270,7 +270,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_address_add_new"
|
android:id="@+id/contact_addresses_add_new"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_addresses_holder"
|
android:layout_below="@+id/contact_addresses_holder"
|
||||||
|
@ -284,7 +284,7 @@
|
||||||
android:src="@drawable/ic_plus"/>
|
android:src="@drawable/ic_plus"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_event_image"
|
android:id="@+id/contact_events_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_events_holder"
|
android:layout_alignTop="@+id/contact_events_holder"
|
||||||
|
@ -298,7 +298,7 @@
|
||||||
android:id="@+id/contact_events_holder"
|
android:id="@+id/contact_events_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_address_add_new"
|
android:layout_below="@+id/contact_addresses_add_new"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -308,7 +308,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_event_add_new"
|
android:id="@+id/contact_events_add_new"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_events_holder"
|
android:layout_below="@+id/contact_events_holder"
|
||||||
|
@ -336,7 +336,7 @@
|
||||||
android:id="@+id/contact_notes"
|
android:id="@+id/contact_notes"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_event_add_new"
|
android:layout_below="@+id/contact_events_add_new"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
android:layout_marginTop="@dimen/normal_margin"
|
||||||
android:layout_toRightOf="@+id/contact_notes_image"
|
android:layout_toRightOf="@+id/contact_notes_image"
|
||||||
|
|
|
@ -167,7 +167,7 @@
|
||||||
android:textSize="@dimen/bigger_text_size"/>
|
android:textSize="@dimen/bigger_text_size"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_number_image"
|
android:id="@+id/contact_numbers_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_numbers_holder"
|
android:layout_alignTop="@+id/contact_numbers_holder"
|
||||||
|
@ -182,12 +182,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_suffix"
|
android:layout_below="@+id/contact_suffix"
|
||||||
android:layout_toRightOf="@+id/contact_number_image"
|
android:layout_toRightOf="@+id/contact_numbers_image"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="@dimen/small_margin"/>
|
android:paddingLeft="@dimen/small_margin"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_email_image"
|
android:id="@+id/contact_emails_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_emails_holder"
|
android:layout_alignTop="@+id/contact_emails_holder"
|
||||||
|
@ -207,7 +207,7 @@
|
||||||
android:paddingLeft="@dimen/small_margin"/>
|
android:paddingLeft="@dimen/small_margin"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_address_image"
|
android:id="@+id/contact_addresses_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_addresses_holder"
|
android:layout_alignTop="@+id/contact_addresses_holder"
|
||||||
|
@ -227,7 +227,7 @@
|
||||||
android:paddingLeft="@dimen/small_margin"/>
|
android:paddingLeft="@dimen/small_margin"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_event_image"
|
android:id="@+id/contact_events_image"
|
||||||
android:layout_width="@dimen/contact_icons_size"
|
android:layout_width="@dimen/contact_icons_size"
|
||||||
android:layout_height="@dimen/contact_icons_size"
|
android:layout_height="@dimen/contact_icons_size"
|
||||||
android:layout_alignTop="@+id/contact_events_holder"
|
android:layout_alignTop="@+id/contact_events_holder"
|
||||||
|
|
Loading…
Reference in New Issue