use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class InboxManager_Test method deleteConversation.
public static void deleteConversation(long conversationId, StatusCallback<Conversation> callback) {
// TODO:
Response rawResponse = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
Conversation conversation = new Conversation();
retrofit2.Response<Conversation> response = retrofit2.Response.success(conversation, rawResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class InboxManager_Test method addMessage.
public static void addMessage(RestBuilder adapter, StatusCallback<Conversation> callback, RestParams params, long conversationId, List<String> recipientIds, String message, long[] includedMessageIds, long[] attachmentIds) {
// TODO:
Response rawResponse = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
Conversation conversation = new Conversation();
retrofit2.Response<Conversation> response = retrofit2.Response.success(conversation, rawResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class InboxManager_Test method createConversation.
public static void createConversation(RestBuilder adapter, RestParams params, List<String> userIDs, String message, String subject, String contextId, boolean isBulk, StatusCallback<List<Conversation>> callback) {
Response rawResponse = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
List<Conversation> conversation = new ArrayList<>();
retrofit2.Response<List<Conversation>> response = retrofit2.Response.success(conversation, rawResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class MessageThreadFragment method setupConversationDetails.
@Override
public void setupConversationDetails() {
Conversation conversation = getConversation();
if (mRecyclerView.getAdapter() == null) {
// If we didn't setup the adapter initially (we didn't start off with the conversation), then do it now
mRecyclerView.setAdapter(getAdapter());
}
setupRecyclerView();
if (conversation.getSubject() == null || conversation.getSubject().trim().isEmpty()) {
mSubject.setText(R.string.no_subject);
} else {
mSubject.setText(conversation.getSubject());
}
mStarred.setImageResource(conversation.isStarred() ? R.drawable.vd_star_filled : R.drawable.vd_star);
ColorUtils.colorIt(ThemePrefs.getBrandColor(), mStarred.getDrawable());
Menu menu = mToolbar.getMenu();
// we don't want the archive option when it is in the sent folder, we've already toggled the visibility of those in initToolbar
boolean isArchived = conversation.getWorkflowState() == Conversation.WorkflowState.ARCHIVED;
if (conversationScope == null || !conversationScope.equals("sent")) {
menu.findItem(R.id.archive).setVisible(!isArchived);
menu.findItem(R.id.unarchive).setVisible(isArchived);
}
// Set theme after menu changes, otherwise menu icons may retain original tint
final int textColor = ThemePrefs.getPrimaryTextColor();
ToolbarColorizeHelper.colorizeToolbar(mToolbar, textColor, getActivity());
}
Aggregations