Commit b378cf2f authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update MessageFormManager.java

parent 73dbba85
......@@ -3,14 +3,13 @@ package chat.rocket.android.layouthelper.chatroom;
import chat.rocket.android.widget.message.MessageFormLayout;
/**
* handling MessageForm.
* Handles MessageForm.
*/
public class MessageFormManager {
private final MessageFormLayout messageFormLayout;
private SendMessageCallback sendMessageCallback;
public MessageFormManager(MessageFormLayout messageFormLayout,
MessageFormLayout.ExtraActionSelectionClickListener callback) {
public MessageFormManager(MessageFormLayout messageFormLayout, MessageFormLayout.ExtraActionSelectionClickListener callback) {
this.messageFormLayout = messageFormLayout;
init(callback);
}
......@@ -24,13 +23,8 @@ public class MessageFormManager {
this.sendMessageCallback = sendMessageCallback;
}
public void clearComposingText() {
messageFormLayout.setText("");
}
public void onMessageSend() {
clearComposingText();
messageFormLayout.setEnabled(true);
}
public void setEditMessage(String message) {
......@@ -38,16 +32,18 @@ public class MessageFormManager {
messageFormLayout.setText(message);
}
public void clearComposingText() {
messageFormLayout.setText("");
}
private void sendMessage(String message) {
if (sendMessageCallback == null) {
return;
}
messageFormLayout.setEnabled(false);
sendMessageCallback.onSubmitText(message);
}
public interface SendMessageCallback {
void onSubmitText(String messageText);
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment