use of com.yellowmessenger.sdk.events.SendMessageEvent in project yellowmessenger-sdk by yellowmessenger.
the class RecyclerChatActivity method sendActionEvent.
public void sendActionEvent(SendActionEvent sendActionEvent) {
ChatMessage chatMessage = new ChatMessage(username, sendActionEvent.getAction().getTitle(), name, true);
addMessage(chatMessage);
chatMessage.setMessageValue(sendActionEvent.getAction().getText() != null ? sendActionEvent.getAction().getText() : sendActionEvent.getAction().getTitle());
EventBus.getDefault().post(new SendMessageEvent(chatMessage));
}
use of com.yellowmessenger.sdk.events.SendMessageEvent in project yellowmessenger-sdk by yellowmessenger.
the class RecyclerChatActivity method sendMessage.
public void sendMessage(View view) {
String message = editText.getText().toString();
if (!message.trim().equals("")) {
ChatMessage chatMessage = new ChatMessage(username, message, name, true);
EventBus.getDefault().post(new SendMessageEvent(chatMessage));
addMessage(chatMessage);
editText.setText("");
optionsLayout.removeAllViews();
}
}
use of com.yellowmessenger.sdk.events.SendMessageEvent in project yellowmessenger-sdk by yellowmessenger.
the class RecyclerChatActivity method sendOption.
public void sendOption(final Question question, final Option option) {
if (option.isLocation()) {
askForLocation();
} else {
optionsLayout.setVisibility(View.GONE);
optionsLayout.removeAllViews();
ChatMessage chatMessage = new ChatMessage(username, option.getLabel(), name, true);
chatMessage.setMessageValue(option.getValue());
EventBus.getDefault().post(new SendMessageEvent(chatMessage));
addMessage(chatMessage);
}
}
Aggregations