From e5f227ba35cf238de6b8946ba3e715dae09dfb47 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 9 Dec 2024 13:49:16 +0100 Subject: [PATCH] Do not list ourselves in group conversation participants if we have left, reworked disabled/encrypted conversation info box --- .../viewmodel/ConversationInfoViewModel.kt | 32 ++++++++------- .../chat_conversation_secured_first_event.xml | 41 +++++++++---------- ...n_send_area_disabled_unsecured_warning.xml | 41 +++++++++---------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/app/src/main/java/org/linphone/ui/main/chat/viewmodel/ConversationInfoViewModel.kt b/app/src/main/java/org/linphone/ui/main/chat/viewmodel/ConversationInfoViewModel.kt index 7d7215864..c12359ce3 100644 --- a/app/src/main/java/org/linphone/ui/main/chat/viewmodel/ConversationInfoViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/chat/viewmodel/ConversationInfoViewModel.kt @@ -556,21 +556,23 @@ class ConversationInfoViewModel @UiThread constructor() : AbstractConversationVi participantsList.add(model) } - // Add ourselves at the end of the list - val meParticipant = chatRoom.me - if (meParticipant != null) { - val model = ParticipantModel( - meParticipant.address, - selfAdmin, - isParticipantAdmin = selfAdmin, - showMenu = false, - isParticipantMyself = true, - onMenuClicked = { view, model -> - // openMenu - showParticipantAdminPopupMenuEvent.postValue(Event(Pair(view, model))) - } - ) - participantsList.add(model) + if (!chatRoom.isReadOnly) { + // Add ourselves at the end of the list + val meParticipant = chatRoom.me + if (meParticipant != null) { + val model = ParticipantModel( + meParticipant.address, + selfAdmin, + isParticipantAdmin = selfAdmin, + showMenu = false, + isParticipantMyself = true, + onMenuClicked = { view, model -> + // openMenu + showParticipantAdminPopupMenuEvent.postValue(Event(Pair(view, model))) + } + ) + participantsList.add(model) + } } } diff --git a/app/src/main/res/layout/chat_conversation_secured_first_event.xml b/app/src/main/res/layout/chat_conversation_secured_first_event.xml index 8135e588d..c6bfda8f6 100644 --- a/app/src/main/res/layout/chat_conversation_secured_first_event.xml +++ b/app/src/main/res/layout/chat_conversation_secured_first_event.xml @@ -17,8 +17,9 @@ android:layout_width="0dp" android:layout_height="0dp" android:contentDescription="@null" + android:layout_marginStart="15dp" + android:layout_marginEnd="15dp" android:background="@drawable/shape_squircle_main2_200_chat_event_border" - app:layout_constraintWidth_max="300dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -26,32 +27,31 @@ + app:layout_constraintBottom_toBottomOf="@id/secured_subtitle" + app:layout_constraintStart_toStartOf="@id/secured_background"/> + app:layout_constraintStart_toEndOf="@id/secured_icon" + app:layout_constraintEnd_toEndOf="@id/secured_background" + app:layout_constraintTop_toBottomOf="@id/secured_title" + app:layout_constraintBottom_toBottomOf="parent"/> diff --git a/app/src/main/res/layout/chat_conversation_send_area_disabled_unsecured_warning.xml b/app/src/main/res/layout/chat_conversation_send_area_disabled_unsecured_warning.xml index 972de6cc3..95184a9a5 100644 --- a/app/src/main/res/layout/chat_conversation_send_area_disabled_unsecured_warning.xml +++ b/app/src/main/res/layout/chat_conversation_send_area_disabled_unsecured_warning.xml @@ -17,8 +17,9 @@ android:layout_width="0dp" android:layout_height="0dp" android:contentDescription="@null" + android:layout_marginStart="15dp" + android:layout_marginEnd="15dp" android:background="@drawable/shape_squircle_main2_200_chat_event_border" - app:layout_constraintWidth_max="300dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -26,32 +27,31 @@ + app:layout_constraintBottom_toBottomOf="@id/disabled_subtitle" + app:layout_constraintStart_toStartOf="@id/disabled_background"/> + app:layout_constraintStart_toEndOf="@id/disabled_icon" + app:layout_constraintEnd_toEndOf="@id/disabled_background" + app:layout_constraintTop_toBottomOf="@id/disabled_title" + app:layout_constraintBottom_toBottomOf="parent"/>