mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Hide reply/forward actions for retracted message
This commit is contained in:
parent
881e2c217b
commit
c153b2d928
2 changed files with 9 additions and 7 deletions
|
|
@ -58,6 +58,8 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
|
|||
|
||||
val isMessageInError = MutableLiveData<Boolean>()
|
||||
|
||||
val hasBeenRetracted = MutableLiveData<Boolean>()
|
||||
|
||||
val showImdnInfoEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -97,14 +99,14 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
|
|||
|
||||
@UiThread
|
||||
fun setMessage(model: MessageModel) {
|
||||
canBeEdited.postValue(model.chatMessage.isEditable)
|
||||
canBeRemotelyDeleted.postValue(model.chatMessage.isRetractable)
|
||||
|
||||
hideCopyTextToClipboard.value = model.text.value.isNullOrEmpty()
|
||||
isChatRoomReadOnly.value = model.chatRoomIsReadOnly
|
||||
isMessageOutgoing.value = model.isOutgoing
|
||||
isMessageInError.value = model.isInError.value == true
|
||||
horizontalBias.value = if (model.isOutgoing) 1f else 0f
|
||||
canBeEdited.value = model.chatMessage.isEditable
|
||||
canBeRemotelyDeleted.value = model.chatMessage.isRetractable
|
||||
hasBeenRetracted.value = model.hasBeenRetracted.value == true
|
||||
messageModel.value = model
|
||||
|
||||
emojiBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/menu_reply_to_chat_message"
|
||||
android:background="@drawable/action_background_middle"
|
||||
android:visibility="@{viewModel.isChatRoomReadOnly ? View.GONE : View.VISIBLE}"
|
||||
android:visibility="@{viewModel.isChatRoomReadOnly || viewModel.hasBeenRetracted ? View.GONE : View.VISIBLE}"
|
||||
android:drawableEnd="@drawable/reply" />
|
||||
|
||||
<View
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
android:layout_height="1dp"
|
||||
android:background="?attr/color_separator"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="@{viewModel.isChatRoomReadOnly ? View.GONE : View.VISIBLE}" />
|
||||
android:visibility="@{viewModel.isChatRoomReadOnly || viewModel.hasBeenRetracted ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/chat_bubble_popup_menu_style"
|
||||
|
|
@ -191,14 +191,14 @@
|
|||
android:text="@string/menu_forward_chat_message"
|
||||
android:background="@drawable/action_background_middle"
|
||||
android:drawableEnd="@drawable/forward"
|
||||
android:visibility="@{viewModel.hideForward ? View.GONE : View.VISIBLE}" />
|
||||
android:visibility="@{viewModel.hideForward || viewModel.hasBeenRetracted ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/color_separator"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="@{viewModel.hideForward ? View.GONE : View.VISIBLE}" />
|
||||
android:visibility="@{viewModel.hideForward || viewModel.hasBeenRetracted ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/chat_bubble_popup_menu_style"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue