From 4801f23cff754ab85f64f2979d7c874e6de0cbed Mon Sep 17 00:00:00 2001 From: sowjanyakch Date: Mon, 16 Dec 2024 17:09:05 +0100 Subject: [PATCH] show send button when there is text in input message field Signed-off-by: sowjanyakch --- .../java/com/nextcloud/talk/chat/MessageInputFragment.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt index d73efeb224..b97ca345b7 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt @@ -474,7 +474,13 @@ class MessageInputFragment : Fragment() { @Suppress("ClickableViewAccessibility", "CyclomaticComplexMethod", "LongMethod") private fun initVoiceRecordButton() { - binding.fragmentMessageInputView.messageSendButton.visibility = View.GONE + if (binding.fragmentMessageInputView.messageInput.text.isNullOrBlank()) { + binding.fragmentMessageInputView.messageSendButton.visibility = View.GONE + binding.fragmentMessageInputView.recordAudioButton.visibility = View.VISIBLE + } else { + binding.fragmentMessageInputView.messageSendButton.visibility = View.VISIBLE + binding.fragmentMessageInputView.recordAudioButton.visibility = View.GONE + } binding.fragmentMessageInputView.inputEditText.doAfterTextChanged { binding.fragmentMessageInputView.recordAudioButton.visibility = if (binding.fragmentMessageInputView.inputEditText.text.isEmpty()) View.VISIBLE else View.GONE