From 07285c48451e03d9a36c709f383501ad8068f701 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Wed, 10 Apr 2019 19:02:02 +0400 Subject: [PATCH] Made preventing sending an empty message --- .../io/github/chronosx88/influence/views/ChatActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/io/github/chronosx88/influence/views/ChatActivity.java b/app/src/main/java/io/github/chronosx88/influence/views/ChatActivity.java index 26c2674..68e579f 100644 --- a/app/src/main/java/io/github/chronosx88/influence/views/ChatActivity.java +++ b/app/src/main/java/io/github/chronosx88/influence/views/ChatActivity.java @@ -50,6 +50,9 @@ public class ChatActivity extends AppCompatActivity implements IChatViewContract messageTextEdit = findViewById(R.id.message_input); sendMessageButton = findViewById(R.id.send_button); sendMessageButton.setOnClickListener((v) -> { + if(messageTextEdit.getText().toString().equals("")) { + return; + } presenter.sendMessage(messageTextEdit.getText().toString()); messageTextEdit.setText(""); messageList.scrollToPosition(chatAdapter.getItemCount()-1);