Merge pull request #4551 from nextcloud/show_send_button

show message send button when there is text in input message field
This commit is contained in:
Marcel Hibbe 2025-01-08 16:58:58 +01:00 committed by GitHub
commit 585f66d8ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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