mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Hide 'copy text' from chat message long press menu if message contains no text
This commit is contained in:
parent
a6b510e536
commit
b5b37bd74d
2 changed files with 7 additions and 2 deletions
|
|
@ -42,6 +42,8 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
|
|||
|
||||
val hideForward = MutableLiveData<Boolean>()
|
||||
|
||||
val hideCopyTextToClipboard = MutableLiveData<Boolean>()
|
||||
|
||||
val horizontalBias = MutableLiveData<Float>()
|
||||
|
||||
val isChatRoomReadOnly = MutableLiveData<Boolean>()
|
||||
|
|
@ -82,6 +84,7 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
|
|||
|
||||
@UiThread
|
||||
fun setMessage(model: MessageModel) {
|
||||
hideCopyTextToClipboard.value = model.text.value.isNullOrEmpty()
|
||||
isChatRoomReadOnly.value = model.chatRoomIsReadOnly
|
||||
isMessageOutgoing.value = model.isOutgoing
|
||||
isMessageInError.value = model.isInError
|
||||
|
|
|
|||
|
|
@ -132,12 +132,14 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/menu_copy_chat_message"
|
||||
android:drawableEnd="@drawable/copy" />
|
||||
android:visibility="@{viewModel.hideCopyTextToClipboard ? View.GONE : View.VISIBLE}"
|
||||
android:drawableEnd="@drawable/copy"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/color_main2_200"/>
|
||||
android:background="?attr/color_main2_200"
|
||||
android:visibility="@{viewModel.hideCopyTextToClipboard ? View.GONE : View.VISIBLE}"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/popup_menu_action_label_style"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue