add rounded corners at the big photo at View Details screen

This commit is contained in:
tibbi 2020-04-28 11:29:20 +02:00
parent 3ec5ae7a07
commit b0c5624e0e
1 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,9 @@ import android.view.View
import android.view.WindowManager
import android.widget.RelativeLayout
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.FitCenter
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
@ -159,7 +162,14 @@ class ViewContactActivity : ContactActivity() {
showPhotoPlaceholder(contact_photo)
} else {
updateContactPhoto(contact!!.photoUri, contact_photo, contact!!.photo)
Glide.with(this).load(contact!!.photo ?: currentContactPhotoPath).into(contact_photo_big)
val options = RequestOptions()
.transform(FitCenter(), RoundedCorners(resources.getDimension(R.dimen.normal_margin).toInt()))
Glide.with(this)
.load(contact!!.photo ?: currentContactPhotoPath)
.apply(options)
.into(contact_photo_big)
contact_photo.setOnClickListener {
contact_photo_big.alpha = 0f
contact_photo_big.beVisible()