From e4c3457f37b20e57dd858faab555e91bc13b890c Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Wed, 6 Oct 2021 19:08:27 +0300 Subject: [PATCH] Add public room indicator to RoomDetailFragment & RoomProfileFragment --- .../home/room/detail/RoomDetailFragment.kt | 1 + .../features/roomprofile/RoomProfileFragment.kt | 1 + .../src/main/res/layout/fragment_room_detail.xml | 16 +++++++++++++++- .../res/layout/view_stub_room_profile_header.xml | 15 +++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 2307bff984..c888c509c1 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -1433,6 +1433,7 @@ class RoomDetailFragment @Inject constructor( renderSubTitle(typingMessage, roomSummary.topic) views.roomToolbarDecorationImageView.render(roomSummary.roomEncryptionTrustLevel) views.roomToolbarPresenceImageView.render(roomSummary.isDirect, roomSummary.directUserPresence) + views.roomToolbarPublicImageView.isVisible = roomSummary.isPublic && !roomSummary.isDirect } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt index e24b558ff0..e07746af85 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt @@ -220,6 +220,7 @@ class RoomProfileFragment @Inject constructor( headerViews.roomProfileDecorationImageView.render(it.roomEncryptionTrustLevel) views.matrixProfileDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel) headerViews.roomProfilePresenceImageView.render(it.isDirect, it.directUserPresence) + headerViews.roomProfilePublicImageView.isVisible = it.isPublic && !it.isDirect } } roomProfileController.setData(state) diff --git a/vector/src/main/res/layout/fragment_room_detail.xml b/vector/src/main/res/layout/fragment_room_detail.xml index 0115c9a66a..ccebeaba95 100644 --- a/vector/src/main/res/layout/fragment_room_detail.xml +++ b/vector/src/main/res/layout/fragment_room_detail.xml @@ -53,7 +53,6 @@ app:layout_constraintStart_toEndOf="@+id/roomToolbarAvatarImageView" app:layout_constraintTop_toTopOf="@+id/roomToolbarTitleView" /> - + + + +