Open room member profile from avatar of the room member state event.

This commit is contained in:
onurays 2020-03-05 18:44:34 +01:00
parent dcb618c257
commit b187699a86
3 changed files with 8 additions and 2 deletions

View file

@ -8,6 +8,7 @@ Improvements 🙌:
- Add support for `/plain` command (#12) - Add support for `/plain` command (#12)
- Detect spaces in password if user fail to login (#1038) - Detect spaces in password if user fail to login (#1038)
- FTUE: do not display a different color when encrypting message when not in developer mode. - FTUE: do not display a different color when encrypting message when not in developer mode.
- Open room member profile from avatar of the room member state event (#935)
Bugfix 🐛: Bugfix 🐛:
- Fix crash on attachment preview screen (#1088) - Fix crash on attachment preview screen (#1088)

View file

@ -44,7 +44,8 @@ class NoticeItemFactory @Inject constructor(private val eventFormatter: NoticeEv
itemLongClickListener = View.OnLongClickListener { view -> itemLongClickListener = View.OnLongClickListener { view ->
callback?.onEventLongClicked(informationData, null, view) ?: false callback?.onEventLongClicked(informationData, null, view) ?: false
}, },
readReceiptsCallback = callback readReceiptsCallback = callback,
avatarClickListener = { callback?.onAvatarClicked(informationData) }
) )
return NoticeItem_() return NoticeItem_()
.leftGuideline(avatarSizeProvider.leftGuideline) .leftGuideline(avatarSizeProvider.leftGuideline)

View file

@ -22,6 +22,8 @@ import android.widget.TextView
import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass import com.airbnb.epoxy.EpoxyModelClass
import im.vector.riotx.R import im.vector.riotx.R
import im.vector.riotx.core.epoxy.ClickListener
import im.vector.riotx.core.epoxy.onClick
import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.core.utils.DebouncedClickListener
import im.vector.riotx.features.home.AvatarRenderer import im.vector.riotx.features.home.AvatarRenderer
import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController
@ -42,6 +44,7 @@ abstract class NoticeItem : BaseEventItem<NoticeItem.Holder>() {
attributes.avatarRenderer.render(attributes.informationData.matrixItem, holder.avatarImageView) attributes.avatarRenderer.render(attributes.informationData.matrixItem, holder.avatarImageView)
holder.view.setOnLongClickListener(attributes.itemLongClickListener) holder.view.setOnLongClickListener(attributes.itemLongClickListener)
holder.readReceiptsView.render(attributes.informationData.readReceipts, attributes.avatarRenderer, _readReceiptsClickListener) holder.readReceiptsView.render(attributes.informationData.readReceipts, attributes.avatarRenderer, _readReceiptsClickListener)
holder.avatarImageView.onClick(attributes.avatarClickListener)
} }
override fun getEventIds(): List<String> { override fun getEventIds(): List<String> {
@ -60,7 +63,8 @@ abstract class NoticeItem : BaseEventItem<NoticeItem.Holder>() {
val informationData: MessageInformationData, val informationData: MessageInformationData,
val noticeText: CharSequence, val noticeText: CharSequence,
val itemLongClickListener: View.OnLongClickListener? = null, val itemLongClickListener: View.OnLongClickListener? = null,
val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback? = null val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback? = null,
val avatarClickListener: ClickListener? = null
) )
companion object { companion object {