Skip to content

Commit

Permalink
show send button when there is text in input message field
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Dec 16, 2024
1 parent d512eed commit 4801f23
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4801f23

Please sign in to comment.