mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 13:48:52 +01:00
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:
@@ -136,7 +136,6 @@ class MessagesAdapter @Inject constructor(
|
|||||||
|
|
||||||
private val contactCache = ContactCache()
|
private val contactCache = ContactCache()
|
||||||
private val expanded = HashMap<Long, Boolean>()
|
private val expanded = HashMap<Long, Boolean>()
|
||||||
private val partsViewPool = RecyclerView.RecycledViewPool()
|
|
||||||
private val subs = subscriptionManager.activeSubscriptionInfoList
|
private val subs = subscriptionManager.activeSubscriptionInfoList
|
||||||
|
|
||||||
var theme: Colors.Theme = colors.theme()
|
var theme: Colors.Theme = colors.theme()
|
||||||
@@ -167,7 +166,6 @@ class MessagesAdapter @Inject constructor(
|
|||||||
val partsAdapter = partsAdapterProvider.get()
|
val partsAdapter = partsAdapterProvider.get()
|
||||||
partsAdapter.clicks.subscribe(partClicks)
|
partsAdapter.clicks.subscribe(partClicks)
|
||||||
view.attachments.adapter = partsAdapter
|
view.attachments.adapter = partsAdapter
|
||||||
view.attachments.setRecycledViewPool(partsViewPool)
|
|
||||||
view.body.forwardTouches(view)
|
view.body.forwardTouches(view)
|
||||||
|
|
||||||
return QkViewHolder(view).apply {
|
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 this item is the active active audio item update the active view holder
|
||||||
if (audioState.partId == part.id)
|
if (audioState.partId == part.id)
|
||||||
audioState.viewHolder = holder
|
audioState.viewHolder = holder
|
||||||
|
|||||||
Reference in New Issue
Block a user