kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
added binding.sendButton.setOnClickListener to MessagesFragment.kt
rodzic
56c8fcddfb
commit
5b26714a1e
|
@ -228,6 +228,17 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
binding.sendButton.setOnClickListener {
|
||||||
|
debug("sendButton click")
|
||||||
|
|
||||||
|
val str = binding.messageInputText.text.toString().trim()
|
||||||
|
if (str.isNotEmpty())
|
||||||
|
model.messagesState.sendMessage(str)
|
||||||
|
binding.messageInputText.setText("") // blow away the string the user just entered
|
||||||
|
|
||||||
|
// requireActivity().hideKeyboard()
|
||||||
|
}
|
||||||
|
|
||||||
binding.messageInputText.on(EditorInfo.IME_ACTION_DONE) {
|
binding.messageInputText.on(EditorInfo.IME_ACTION_DONE) {
|
||||||
debug("did IME action")
|
debug("did IME action")
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:imeOptions="actionDone"
|
android:imeOptions="actionDone"
|
||||||
android:singleLine="true"
|
|
||||||
android:text="" />
|
android:text="" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
Ładowanie…
Reference in New Issue