Merge pull request #3282 from nextcloud/message-draft-bug-1

Message draft bug fix
This commit is contained in:
Andy Scherzinger 2023-08-28 21:55:30 +02:00 committed by GitHub
commit 9023334f89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}