hide SMS and Call actions when no number is available

This commit is contained in:
tibbi 2017-12-11 21:15:40 +01:00
parent 5b514d5b92
commit db2ee05b5c
2 changed files with 39 additions and 39 deletions

View File

@ -62,6 +62,8 @@ 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_photo.background = ColorDrawable(config.primaryColor)

View File

@ -16,30 +16,30 @@
android:layout_width="@dimen/contact_photo_size"
android:layout_height="@dimen/contact_photo_size"/>
<LinearLayout
android:id="@+id/contact_actions_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/contact_photo"
android:layout_alignTop="@+id/contact_photo"
android:gravity="center_vertical|right">
<ImageView
android:id="@+id/contact_send_sms"
android:id="@+id/contact_send_email"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/contact_photo"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/contact_photo"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:scaleType="center"
android:src="@drawable/ic_sms"/>
android:src="@drawable/ic_email"/>
<ImageView
android:id="@+id/contact_start_call"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/contact_photo"
android:layout_alignTop="@+id/contact_photo"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/contact_send_sms"
android:adjustViewBounds="true"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
@ -47,19 +47,17 @@
android:src="@drawable/ic_phone"/>
<ImageView
android:id="@+id/contact_send_email"
android:id="@+id/contact_send_sms"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/contact_photo"
android:layout_alignTop="@+id/contact_photo"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/contact_start_call"
android:adjustViewBounds="true"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:scaleType="center"
android:src="@drawable/ic_email"/>
android:src="@drawable/ic_sms"/>
</LinearLayout>
<ImageView
android:id="@+id/contact_name_image"