From e1f538a9e6f5910cbd4959f612fe789a650a1f33 Mon Sep 17 00:00:00 2001 From: Julius Linus Date: Mon, 28 Aug 2023 10:30:24 -0500 Subject: [PATCH] message draft bug fix Signed-off-by: rapterjet2004 --- app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 450f6a078..8acd7ef1c 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -1004,7 +1004,11 @@ class ChatActivity : @SuppressLint("ClickableViewAccessibility") private fun initVoiceRecordButton() { if (!isVoiceRecordingLocked) { - showMicrophoneButton(true) + if (binding.messageInputView.messageInput.text!!.isNotEmpty()) { + showMicrophoneButton(false) + } else { + showMicrophoneButton(true) + } } else if (isVoiceRecordingInProgress) { binding.messageInputView.playPauseBtn.visibility = View.GONE binding.messageInputView.seekBar.visibility = View.GONE @@ -3979,9 +3983,11 @@ class ChatActivity : private fun showMicrophoneButton(show: Boolean) { if (show && CapabilitiesUtilNew.hasSpreedFeatureCapability(conversationUser, "voice-message-sharing")) { + Log.d(TAG, "Microphone shown") binding.messageInputView.messageSendButton.visibility = View.GONE binding.messageInputView.recordAudioButton.visibility = View.VISIBLE } else { + Log.d(TAG, "Microphone hidden") binding.messageInputView.messageSendButton.visibility = View.VISIBLE binding.messageInputView.recordAudioButton.visibility = View.GONE }