add Plus buttons for adding new numbers and emails

This commit is contained in:
tibbi 2017-12-18 12:08:50 +01:00
parent 417c6edc6e
commit 1599334ee0
2 changed files with 41 additions and 7 deletions

View file

@ -68,9 +68,9 @@ class ContactActivity : SimpleActivity() {
setupEditContact()
}
//contact_send_sms.beVisibleIf(contact!!.number.isNotEmpty())
//contact_start_call.beVisibleIf(contact!!.number.isNotEmpty())
//contact_send_email.beVisibleIf(contact!!.email.isNotEmpty())
contact_send_sms.beVisibleIf(contact!!.phoneNumbers.isNotEmpty())
contact_start_call.beVisibleIf(contact!!.phoneNumbers.isNotEmpty())
contact_send_email.beVisibleIf(contact!!.emails.isNotEmpty())
contact_photo.background = ColorDrawable(config.primaryColor)
@ -103,6 +103,10 @@ class ContactActivity : SimpleActivity() {
contact_number_image.applyColorFilter(textColor)
contact_email_image.applyColorFilter(textColor)
contact_source_image.applyColorFilter(textColor)
contact_number_add_new.applyColorFilter(config.primaryColor)
contact_number_add_new.background.applyColorFilter(textColor)
contact_email_add_new.applyColorFilter(config.primaryColor)
contact_email_add_new.background.applyColorFilter(textColor)
contact_photo.setOnClickListener { }
//contact_send_sms.setOnClickListener { sendSMSIntent(contact!!.number) }
@ -111,6 +115,8 @@ class ContactActivity : SimpleActivity() {
contact_source.setOnClickListener { showAccountSourcePicker() }
contact_number_type.setOnClickListener { }
contact_email_type.setOnClickListener { }
contact_number_add_new.setOnClickListener { }
contact_email_add_new.setOnClickListener { }
updateTextColors(contact_scrollview)
wasActivityInitialized = true

View file

@ -166,6 +166,20 @@
android:text="@string/mobile"
android:textSize="@dimen/bigger_text_size"/>
<ImageView
android:id="@+id/contact_number_add_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_number"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/small_margin"
android:background="@drawable/button_background"
android:paddingBottom="@dimen/medium_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin"
android:src="@drawable/ic_plus"/>
<ImageView
android:id="@+id/contact_email_image"
android:layout_width="wrap_content"
@ -180,11 +194,11 @@
android:id="@+id/contact_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_number"
android:layout_below="@+id/contact_number_add_new"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/medium_margin"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginTop="@dimen/normal_margin"
android:layout_marginTop="@dimen/medium_margin"
android:layout_toLeftOf="@+id/contact_email_type"
android:layout_toRightOf="@+id/contact_name_image"
android:hint="@string/email"
@ -209,6 +223,20 @@
android:text="@string/home"
android:textSize="@dimen/bigger_text_size"/>
<ImageView
android:id="@+id/contact_email_add_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_email"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/small_margin"
android:background="@drawable/button_background"
android:paddingBottom="@dimen/medium_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin"
android:src="@drawable/ic_plus"/>
<ImageView
android:id="@+id/contact_source_image"
android:layout_width="wrap_content"
@ -223,11 +251,11 @@
android:id="@+id/contact_source"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_email"
android:layout_below="@+id/contact_email_add_new"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/medium_margin"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginTop="@dimen/normal_margin"
android:layout_marginTop="@dimen/medium_margin"
android:layout_toRightOf="@+id/contact_name_image"
android:background="?attr/selectableItemBackground"
android:lines="1"