Skip to content

Commit

Permalink
message draft bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
  • Loading branch information
Julius Linus authored and rapterjet2004 committed Aug 28, 2023
1 parent 993cee0 commit e1f538a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e1f538a

Please sign in to comment.