show the contact notes at the View screen

This commit is contained in:
tibbi
2018-02-22 14:15:39 +01:00
parent 8edab98cb3
commit ac99c14c96
2 changed files with 34 additions and 2 deletions

View File

@ -113,6 +113,7 @@ class ViewContactActivity : ContactActivity() {
contact_email_image.applyColorFilter(textColor)
contact_event_image.applyColorFilter(textColor)
contact_source_image.applyColorFilter(textColor)
contact_notes_image.applyColorFilter(textColor)
contact_send_sms.setOnClickListener { trySendSMS() }
contact_start_call.setOnClickListener { tryStartCall(contact!!) }
@ -152,6 +153,7 @@ class ViewContactActivity : ContactActivity() {
setupEmails()
setupAddresses()
setupEvents()
setupNotes()
}
private fun setupPhoneNumbers() {
@ -216,5 +218,12 @@ class ViewContactActivity : ContactActivity() {
contact_events_holder.beVisibleIf(events.isNotEmpty())
}
private fun setupNotes() {
val notes = contact!!.notes
contact_notes.text = notes
contact_notes_image.beVisibleIf(notes.isNotEmpty())
contact_notes.beVisibleIf(notes.isNotEmpty())
}
private fun getStarDrawable(on: Boolean) = resources.getDrawable(if (on) R.drawable.ic_star_on_big else R.drawable.ic_star_off_big)
}