forked from GitHub-Mirror/riotX-android
Add long click support on unsupported event
This commit is contained in:
parent
ef0362ba9c
commit
c95223f5d2
@ -44,6 +44,7 @@ class DefaultItemFactory @Inject constructor(private val avatarRenderer: AvatarR
|
||||
.avatarRenderer(avatarRenderer)
|
||||
.highlighted(highlight)
|
||||
.informationData(informationData)
|
||||
.baseCallback(callback)
|
||||
.readReceiptsCallback(callback)
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,13 @@ abstract class DefaultItem : BaseEventItem<DefaultItem.Holder>() {
|
||||
@EpoxyAttribute
|
||||
lateinit var avatarRenderer: AvatarRenderer
|
||||
|
||||
@EpoxyAttribute
|
||||
var baseCallback: TimelineEventController.BaseCallback? = null
|
||||
|
||||
private var longClickListener = View.OnLongClickListener {
|
||||
return@OnLongClickListener baseCallback?.onEventLongClicked(informationData, null, it) == true
|
||||
}
|
||||
|
||||
@EpoxyAttribute
|
||||
var readReceiptsCallback: TimelineEventController.ReadReceiptsCallback? = null
|
||||
|
||||
@ -47,6 +54,7 @@ abstract class DefaultItem : BaseEventItem<DefaultItem.Holder>() {
|
||||
override fun bind(holder: Holder) {
|
||||
holder.messageView.text = text
|
||||
|
||||
holder.view.setOnLongClickListener(longClickListener)
|
||||
holder.readReceiptsView.render(informationData.readReceipts, avatarRenderer, _readReceiptsClickListener)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user