adding a divider under the contacts photo

This commit is contained in:
tibbi 2020-10-26 12:53:04 +01:00
parent 7e2b41b398
commit 0efae2f760
2 changed files with 16 additions and 7 deletions

View File

@ -182,14 +182,14 @@ class ViewContactActivity : ContactActivity() {
val path = contact!!.photoUri
currentContactPhotoPath = path
val options = RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.centerCrop()
if (isDestroyed || isFinishing) {
return
}
val options = RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.centerCrop()
val wantedWidth = realScreenSize.x
val wantedHeight = resources.getDimension(R.dimen.top_contact_image_height).toInt()
@ -202,6 +202,7 @@ class ViewContactActivity : ContactActivity() {
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
contact_photo.background = ColorDrawable(0)
contact_photo_bottom_shadow.beVisible()
contact_photo_divider.beInvisible()
return false
}

View File

@ -20,7 +20,6 @@
android:id="@+id/contact_photo"
android:layout_width="match_parent"
android:layout_height="@dimen/top_contact_image_height"
android:layout_marginBottom="@dimen/normal_margin"
android:src="@drawable/ic_person_vector" />
<ImageView
@ -31,6 +30,15 @@
android:background="@drawable/gradient_background"
android:contentDescription="@null" />
<ImageView
android:id="@+id/contact_photo_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/contact_photo"
android:layout_marginBottom="@dimen/normal_margin"
android:background="@color/divider_grey"
android:importantForAccessibility="no" />
<ImageView
android:id="@+id/contact_toggle_favorite"
android:layout_width="@dimen/contact_actions_size"
@ -93,7 +101,7 @@
android:id="@+id/contact_name_image"
android:layout_width="@dimen/contact_icons_size"
android:layout_height="@dimen/contact_icons_size"
android:layout_below="@+id/contact_photo"
android:layout_below="@+id/contact_photo_divider"
android:layout_marginStart="@dimen/normal_margin"
android:paddingTop="@dimen/medium_margin"
android:paddingEnd="@dimen/small_margin"
@ -104,7 +112,7 @@
android:id="@+id/contact_prefix"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/contact_photo"
android:layout_below="@+id/contact_photo_divider"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/contact_name_image"
android:background="?attr/selectableItemBackground"