mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-17 03:51:03 +01:00
properly show contact avatars at SelectContact activity
This commit is contained in:
parent
3603d92674
commit
e3712ca223
@ -51,7 +51,7 @@ abstract class ContactActivity : SimpleActivity() {
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.centerCrop()
|
||||
|
||||
if (isDestroyed) {
|
||||
if (isDestroyed || isFinishing) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
}
|
||||
|
||||
override fun refreshContacts(refreshTabsMask: Int) {
|
||||
if (isDestroyed || isGettingContacts) {
|
||||
if (isDestroyed || isFinishing || isGettingContacts) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||
|
||||
ContactsHelper(this).getContacts { contacts ->
|
||||
isGettingContacts = false
|
||||
if (isDestroyed) {
|
||||
if (isDestroyed || isFinishing) {
|
||||
return@getContacts
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class SelectContactActivity : SimpleActivity() {
|
||||
|
||||
private fun initContacts() {
|
||||
ContactsHelper(this).getContacts {
|
||||
if (isDestroyed) {
|
||||
if (isDestroyed || isFinishing) {
|
||||
return@getContacts
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
|
||||
|
||||
override fun onViewRecycled(holder: ViewHolder) {
|
||||
super.onViewRecycled(holder)
|
||||
if (!activity.isDestroyed) {
|
||||
if (!activity.isDestroyed && !activity.isFinishing) {
|
||||
Glide.with(activity).clear(holder.itemView.contact_tmb)
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class SelectContactsAdapter(val activity: SimpleActivity, val contacts: List<Con
|
||||
.error(contactDrawable)
|
||||
.centerCrop()
|
||||
|
||||
if (activity.isDestroyed) {
|
||||
if (!activity.isDestroyed && !activity.isFinishing) {
|
||||
Glide.with(activity).load(contact.photoUri).transition(DrawableTransitionOptions.withCrossFade()).apply(options).into(contact_tmb)
|
||||
}
|
||||
} else {
|
||||
@ -136,7 +136,7 @@ class SelectContactsAdapter(val activity: SimpleActivity, val contacts: List<Con
|
||||
|
||||
override fun onViewRecycled(holder: ViewHolder) {
|
||||
super.onViewRecycled(holder)
|
||||
if (!activity.isDestroyed) {
|
||||
if (!activity.isDestroyed && !activity.isFinishing) {
|
||||
Glide.with(activity).clear(holder.itemView.contact_tmb)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user