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)
}

View File

@ -215,6 +215,30 @@
android:layout_toRightOf="@+id/contact_name_image"
android:orientation="vertical"/>
<ImageView
android:id="@+id/contact_notes_image"
android:layout_width="@dimen/contact_icons_size"
android:layout_height="@dimen/contact_icons_size"
android:layout_alignTop="@+id/contact_notes"
android:paddingBottom="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:paddingRight="@dimen/small_margin"
android:paddingTop="@dimen/medium_margin"
android:src="@drawable/ic_label"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/contact_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_events_holder"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/contact_notes_image"
android:lineSpacingExtra="@dimen/medium_margin"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/small_margin"
android:paddingTop="@dimen/normal_margin"
android:textSize="@dimen/bigger_text_size"/>
<ImageView
android:id="@+id/contact_source_image"
android:layout_width="@dimen/contact_icons_size"
@ -230,10 +254,9 @@
android:id="@+id/contact_source"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_events_holder"
android:layout_below="@+id/contact_notes"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/contact_name_image"
android:background="?attr/selectableItemBackground"
android:lines="1"
android:maxLines="1"
android:paddingBottom="@dimen/normal_margin"