Skip to content

Commit

Permalink
Merge pull request #1298 from bemusementpark/fix-send-whitespace
Browse files Browse the repository at this point in the history
Hide send button when message contains only whitespace
  • Loading branch information
ThomasSession authored Jun 24, 2024
2 parents 01655b8 + 031a180 commit 752f8cc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 752f8cc

Please sign in to comment.