use of drift.com.drift.model.MessageRequest in project drift-sdk-android by Driftt.
the class ConversationActivity method resendMessage.
void resendMessage(final Message message) {
MessageRequest messageRequest = new MessageRequest(message.body, endUserId, null, this);
sendMessageRequest(messageRequest, message);
}
use of drift.com.drift.model.MessageRequest in project drift-sdk-android by Driftt.
the class ConversationActivity method createConversation.
void createConversation() {
final String textToSend = textEntryEditText.getText().toString();
final MessageRequest messageRequest = new MessageRequest(textToSend, endUserId, null, this);
final Message message = messageRequest.messageFromRequest(conversationId);
progressBar.setVisibility(View.VISIBLE);
MessageManager.getInstance().createConversation(textToSend, new APICallbackWrapper<Message>() {
@Override
public void onResponse(Message response) {
progressBar.setVisibility(View.GONE);
if (response != null) {
conversationId = response.conversationId;
conversationType = ConversationType.CONTINUE;
message.sendStatus = Message.SendStatus.SENT;
conversationAdapter.addMessage(recyclerView, message);
updateForConversationType();
} else {
conversationAdapter.updateData(new ArrayList<Message>());
textEntryEditText.setText(textToSend);
Alert.showAlert(ConversationActivity.this, "Error", "Failed to create conversation", "Retry", new Runnable() {
@Override
public void run() {
didPressSendButton();
}
});
}
}
});
}
use of drift.com.drift.model.MessageRequest in project drift-sdk-android by Driftt.
the class ConversationActivity method sendMessage.
void sendMessage() {
MessageRequest messageRequest = new MessageRequest(textEntryEditText.getText().toString(), endUserId, null, this);
final Message message = messageRequest.messageFromRequest(conversationId);
conversationAdapter.addMessage(recyclerView, message);
sendMessageRequest(messageRequest, message);
}
Aggregations