show send button when there is text in input message field

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-12-16 17:09:05 +01:00 committed by Marcel Hibbe
parent 1f908f8bae
commit d36f3c92c6
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

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