hide SMS and Call actions when no number is available
This commit is contained in:
parent
5b514d5b92
commit
db2ee05b5c
|
@ -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)
|
||||
|
|
|
@ -16,50 +16,48 @@
|
|||
android:layout_width="@dimen/contact_photo_size"
|
||||
android:layout_height="@dimen/contact_photo_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_send_sms"
|
||||
style="@style/MyBorderlessBackgroundStyle"
|
||||
android:layout_width="wrap_content"
|
||||
<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_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:gravity="center_vertical|right">
|
||||
|
||||
<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"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_phone"/>
|
||||
<ImageView
|
||||
android:id="@+id/contact_send_email"
|
||||
style="@style/MyBorderlessBackgroundStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_email"/>
|
||||
|
||||
<ImageView
|
||||
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_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"/>
|
||||
<ImageView
|
||||
android:id="@+id/contact_start_call"
|
||||
style="@style/MyBorderlessBackgroundStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_phone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_send_sms"
|
||||
style="@style/MyBorderlessBackgroundStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_sms"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_name_image"
|
||||
|
|
Loading…
Reference in New Issue