From d5f8931e20fc4d8cb6ceca5a4a01e76f57e0e90e Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 9 Dec 2021 15:54:37 +0300 Subject: [PATCH] Support to show hidden poll events as formatted. --- .../home/room/detail/timeline/factory/TimelineItemFactory.kt | 4 +++- .../home/room/detail/timeline/format/NoticeEventFormatter.kt | 4 +++- vector/src/main/res/layout/item_timeline_event_base.xml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/TimelineItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/TimelineItemFactory.kt index 9e95dff26b..c6b128315f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/TimelineItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/TimelineItemFactory.kt @@ -75,7 +75,9 @@ class TimelineItemFactory @Inject constructor(private val messageItemFactory: Me EventType.REACTION, EventType.STATE_SPACE_CHILD, EventType.STATE_SPACE_PARENT, - EventType.STATE_ROOM_POWER_LEVELS -> noticeItemFactory.create(params) + EventType.STATE_ROOM_POWER_LEVELS, + EventType.POLL_RESPONSE, + EventType.POLL_END -> noticeItemFactory.create(params) EventType.STATE_ROOM_WIDGET_LEGACY, EventType.STATE_ROOM_WIDGET -> widgetItemFactory.create(params) EventType.STATE_ROOM_ENCRYPTION -> encryptionItemFactory.create(params) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/NoticeEventFormatter.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/NoticeEventFormatter.kt index 4ca1557208..3dc46c9d70 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/NoticeEventFormatter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/format/NoticeEventFormatter.kt @@ -103,7 +103,9 @@ class NoticeEventFormatter @Inject constructor( EventType.KEY_VERIFICATION_READY, EventType.STATE_SPACE_CHILD, EventType.STATE_SPACE_PARENT, - EventType.REDACTION -> formatDebug(timelineEvent.root) + EventType.REDACTION, + EventType.POLL_RESPONSE, + EventType.POLL_END -> formatDebug(timelineEvent.root) else -> { Timber.v("Type $type not handled by this formatter") null diff --git a/vector/src/main/res/layout/item_timeline_event_base.xml b/vector/src/main/res/layout/item_timeline_event_base.xml index b507017bb3..bd39c08d54 100644 --- a/vector/src/main/res/layout/item_timeline_event_base.xml +++ b/vector/src/main/res/layout/item_timeline_event_base.xml @@ -127,7 +127,7 @@ + android:layout="@layout/item_timeline_event_poll" />