mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 21:48:50 +03:00
Timeline: clear some resources when unbind
This commit is contained in:
parent
6dc5b126d6
commit
0e0db67aef
3 changed files with 12 additions and 0 deletions
|
@ -23,6 +23,7 @@ import android.widget.ImageView
|
|||
import android.widget.LinearLayout
|
||||
import androidx.core.view.isVisible
|
||||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.glide.GlideApp
|
||||
import im.vector.riotx.features.home.AvatarRenderer
|
||||
import im.vector.riotx.features.home.room.detail.timeline.item.ReadReceiptData
|
||||
import kotlinx.android.synthetic.main.view_read_receipts.view.*
|
||||
|
@ -105,4 +106,12 @@ class ReadReceiptsView @JvmOverloads constructor(
|
|||
isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
fun unbind() {
|
||||
receiptAvatars.forEach {
|
||||
GlideApp.with(context.applicationContext).clear(it)
|
||||
}
|
||||
isVisible = false
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -139,6 +139,7 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : BaseEventItem<H>() {
|
|||
|
||||
override fun unbind(holder: H) {
|
||||
holder.readMarkerView.unbind()
|
||||
holder.readReceiptsView.unbind()
|
||||
super.unbind(holder)
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import androidx.core.view.isVisible
|
|||
import com.airbnb.epoxy.EpoxyAttribute
|
||||
import com.airbnb.epoxy.EpoxyModelClass
|
||||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.glide.GlideApp
|
||||
import im.vector.riotx.features.home.room.detail.timeline.helper.ContentUploadStateTrackerBinder
|
||||
import im.vector.riotx.features.media.ImageContentRenderer
|
||||
|
||||
|
@ -60,6 +61,7 @@ abstract class MessageImageVideoItem : AbsMessageItem<MessageImageVideoItem.Hold
|
|||
}
|
||||
|
||||
override fun unbind(holder: Holder) {
|
||||
GlideApp.with(holder.view.context.applicationContext).clear(holder.imageView)
|
||||
contentUploadStateTrackerBinder.unbind(attributes.informationData.eventId)
|
||||
super.unbind(holder)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue