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

Delete MessageFormManager.java

parent 1e4d95a0
package chat.rocket.android.layouthelper.chatroom;
import chat.rocket.android.widget.message.MessageFormLayout;
/**
* Handles MessageForm.
*/
public class MessageFormManager {
private final MessageFormLayout messageFormLayout;
private SendMessageCallback sendMessageCallback;
public MessageFormManager(MessageFormLayout messageFormLayout, MessageFormLayout.ExtraActionSelectionClickListener callback) {
this.messageFormLayout = messageFormLayout;
init(callback);
}
private void init(MessageFormLayout.ExtraActionSelectionClickListener listener) {
messageFormLayout.setExtraActionSelectionClickListener(listener);
messageFormLayout.setSubmitTextListener(this::sendMessage);
}
public void setSendMessageCallback(SendMessageCallback sendMessageCallback) {
this.sendMessageCallback = sendMessageCallback;
}
public void onMessageSend() {
clearComposingText();
}
public void setEditMessage(String message) {
clearComposingText();
messageFormLayout.setText(message);
}
public void clearComposingText() {
messageFormLayout.setText("");
}
private void sendMessage(String message) {
if (sendMessageCallback == null) {
return;
}
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