Merge pull request #1298 from bemusementpark/fix-send-whitespace

Hide send button when message contains only whitespace
This commit is contained in:
ThomasSession 2024-06-24 17:27:45 +10:00 committed by GitHub
commit 752f8cc738
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ import android.view.MotionEvent
import android.view.inputmethod.EditorInfo
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.core.view.isGone
import androidx.core.view.isVisible
import network.loki.messenger.R
import network.loki.messenger.databinding.ViewInputBarBinding
@ -119,8 +120,8 @@ class InputBar : RelativeLayout, InputBarEditTextDelegate, QuoteViewDelegate, Li
// region Updating
override fun inputBarEditTextContentChanged(text: CharSequence) {
sendButton.isVisible = text.isNotEmpty()
microphoneButton.isVisible = text.isEmpty()
microphoneButton.isVisible = text.trim().isEmpty()
sendButton.isVisible = microphoneButton.isGone
delegate?.inputBarEditTextContentChanged(text)
}