mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2024-12-11 16:05:49 +01:00
avoid recycling contact images if the activity is destroyed
This commit is contained in:
parent
197eb7b60c
commit
7063b9ffd2
@ -13,6 +13,7 @@ import com.bumptech.glide.signature.ObjectKey
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
|
||||
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
|
||||
import com.simplemobiletools.commons.extensions.isActivityDestroyed
|
||||
import com.simplemobiletools.commons.interfaces.MyAdapterListener
|
||||
import com.simplemobiletools.contacts.R
|
||||
import com.simplemobiletools.contacts.activities.SimpleActivity
|
||||
@ -124,6 +125,8 @@ class SelectContactsAdapter(val activity: SimpleActivity, val contacts: List<Con
|
||||
|
||||
override fun onViewRecycled(holder: ViewHolder?) {
|
||||
super.onViewRecycled(holder)
|
||||
Glide.with(activity).clear(holder?.itemView?.contact_tmb!!)
|
||||
if (!activity.isActivityDestroyed()) {
|
||||
Glide.with(activity).clear(holder?.itemView?.contact_tmb!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user