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()
|
setupEditContact()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contact_send_sms.beVisibleIf(contact!!.number.isNotEmpty())
|
||||||
|
contact_start_call.beVisibleIf(contact!!.number.isNotEmpty())
|
||||||
contact_send_email.beVisibleIf(contact!!.email.isNotEmpty())
|
contact_send_email.beVisibleIf(contact!!.email.isNotEmpty())
|
||||||
|
|
||||||
contact_photo.background = ColorDrawable(config.primaryColor)
|
contact_photo.background = ColorDrawable(config.primaryColor)
|
||||||
|
|
|
@ -16,30 +16,30 @@
|
||||||
android:layout_width="@dimen/contact_photo_size"
|
android:layout_width="@dimen/contact_photo_size"
|
||||||
android:layout_height="@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
|
<ImageView
|
||||||
android:id="@+id/contact_send_sms"
|
android:id="@+id/contact_send_email"
|
||||||
style="@style/MyBorderlessBackgroundStyle"
|
style="@style/MyBorderlessBackgroundStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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:adjustViewBounds="true"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/activity_margin"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:src="@drawable/ic_sms"/>
|
android:src="@drawable/ic_email"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_start_call"
|
android:id="@+id/contact_start_call"
|
||||||
style="@style/MyBorderlessBackgroundStyle"
|
style="@style/MyBorderlessBackgroundStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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:adjustViewBounds="true"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/activity_margin"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
|
@ -47,19 +47,17 @@
|
||||||
android:src="@drawable/ic_phone"/>
|
android:src="@drawable/ic_phone"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_send_email"
|
android:id="@+id/contact_send_sms"
|
||||||
style="@style/MyBorderlessBackgroundStyle"
|
style="@style/MyBorderlessBackgroundStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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:adjustViewBounds="true"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/activity_margin"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:src="@drawable/ic_email"/>
|
android:src="@drawable/ic_sms"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_name_image"
|
android:id="@+id/contact_name_image"
|
||||||
|
|
Loading…
Reference in New Issue