use of com.instructure.canvasapi2.models.Message in project instructure-android by instructure.
the class DiscussionEntryHTMLHelper method getContentHTML.
private static String getContentHTML(DiscussionEntry discussionEntry, String message) {
if (message == null || message.equals("null")) {
return "";
} else {
StringBuilder html = new StringBuilder();
html.append("<div class=\"width\">");
html.append(message);
for (RemoteFile attachment : discussionEntry.getAttachments()) {
if (!attachment.isHiddenForUser() && !discussionEntry.isDeleted()) {
html.append("<div class=\"nowrap\">");
html.append(String.format("<img class=\"attachment_img\" src=\"" + ATTACHMENT_ICON + "\" /> <a class=\"attachment_link\" href=\"%s\">%s</a>", attachment.getUrl(), attachment.getDisplayName()));
html.append("</div>");
}
}
html.append("</div>");
return html.toString();
}
}
Aggregations