added onclick listener to audiobinder. removed recycledviewpool from parts adapter because it was recycling too fast and messing with attachment/part selection

This commit is contained in:
gavine99
2025-01-27 20:35:33 +11:00
parent b7a8389bf6
commit 580ad9d02d
2 changed files with 2 additions and 2 deletions
@@ -136,7 +136,6 @@ class MessagesAdapter @Inject constructor(
private val contactCache = ContactCache()
private val expanded = HashMap<Long, Boolean>()
private val partsViewPool = RecyclerView.RecycledViewPool()
private val subs = subscriptionManager.activeSubscriptionInfoList
var theme: Colors.Theme = colors.theme()
@@ -167,7 +166,6 @@ class MessagesAdapter @Inject constructor(
val partsAdapter = partsAdapterProvider.get()
partsAdapter.clicks.subscribe(partClicks)
view.attachments.adapter = partsAdapter
view.attachments.setRecycledViewPool(partsViewPool)
view.body.forwardTouches(view)
return QkViewHolder(view).apply {
@@ -169,6 +169,8 @@ class AudioBinder @Inject constructor(colors: Colors, private val context: Conte
}
}
holder.containerView.setOnClickListener { clicks.onNext(part.id) }
// if this item is the active active audio item update the active view holder
if (audioState.partId == part.id)
audioState.viewHolder = holder