mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-10 16:40:40 +01:00
properly show avatars of local events at the Add favorites dialog
This commit is contained in:
parent
36a15478b4
commit
67a3053227
@ -40,6 +40,7 @@ class SelectContactsAdapter(val activity: SimpleActivity, var contacts: ArrayLis
|
|||||||
private var textToHighlight = ""
|
private var textToHighlight = ""
|
||||||
|
|
||||||
private var smallPadding = activity.resources.getDimension(R.dimen.small_margin).toInt()
|
private var smallPadding = activity.resources.getDimension(R.dimen.small_margin).toInt()
|
||||||
|
private var mediumPadding = activity.resources.getDimension(R.dimen.medium_margin).toInt()
|
||||||
private var bigPadding = activity.resources.getDimension(R.dimen.normal_margin).toInt()
|
private var bigPadding = activity.resources.getDimension(R.dimen.normal_margin).toInt()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@ -161,8 +162,24 @@ class SelectContactsAdapter(val activity: SimpleActivity, var contacts: ArrayLis
|
|||||||
.apply(options)
|
.apply(options)
|
||||||
.apply(RequestOptions.circleCropTransform())
|
.apply(RequestOptions.circleCropTransform())
|
||||||
.into(contact_tmb)
|
.into(contact_tmb)
|
||||||
|
contact_tmb.setPadding(smallPadding, smallPadding, smallPadding, smallPadding)
|
||||||
}
|
}
|
||||||
|
} else if (contact.photo != null) {
|
||||||
|
val options = RequestOptions()
|
||||||
|
.signature(ObjectKey(contact.hashCode()))
|
||||||
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||||
|
.error(contactDrawable)
|
||||||
|
.centerCrop()
|
||||||
|
|
||||||
|
Glide.with(activity)
|
||||||
|
.load(contact.photo)
|
||||||
|
.transition(DrawableTransitionOptions.withCrossFade())
|
||||||
|
.apply(options)
|
||||||
|
.apply(RequestOptions.circleCropTransform())
|
||||||
|
.into(contact_tmb)
|
||||||
|
contact_tmb.setPadding(smallPadding, smallPadding, smallPadding, smallPadding)
|
||||||
} else {
|
} else {
|
||||||
|
contact_tmb.setPadding(mediumPadding, mediumPadding, mediumPadding, mediumPadding)
|
||||||
contact_tmb.setImageDrawable(contactDrawable)
|
contact_tmb.setImageDrawable(contactDrawable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user