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,50 +16,48 @@
|
||||||
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"/>
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/contact_send_sms"
|
android:id="@+id/contact_actions_holder"
|
||||||
style="@style/MyBorderlessBackgroundStyle"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBottom="@id/contact_photo"
|
android:layout_alignBottom="@id/contact_photo"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignTop="@+id/contact_photo"
|
android:layout_alignTop="@+id/contact_photo"
|
||||||
android:layout_centerVertical="true"
|
android:gravity="center_vertical|right">
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/activity_margin"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:src="@drawable/ic_sms"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_start_call"
|
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:adjustViewBounds="true"
|
||||||
android:layout_alignTop="@+id/contact_photo"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:layout_centerVertical="true"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
android:layout_toLeftOf="@+id/contact_send_sms"
|
android:scaleType="center"
|
||||||
android:adjustViewBounds="true"
|
android:src="@drawable/ic_email"/>
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/activity_margin"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:src="@drawable/ic_phone"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_send_email"
|
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:adjustViewBounds="true"
|
||||||
android:layout_alignTop="@+id/contact_photo"
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
android:layout_centerVertical="true"
|
android:paddingRight="@dimen/activity_margin"
|
||||||
android:layout_toLeftOf="@+id/contact_start_call"
|
android:scaleType="center"
|
||||||
android:adjustViewBounds="true"
|
android:src="@drawable/ic_phone"/>
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
|
||||||
android:paddingRight="@dimen/activity_margin"
|
<ImageView
|
||||||
android:scaleType="center"
|
android:id="@+id/contact_send_sms"
|
||||||
android:src="@drawable/ic_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_sms"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_name_image"
|
android:id="@+id/contact_name_image"
|
||||||
|
|
Loading…
Reference in New Issue