Search in sources :

Example 81 with Message

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();
    }
}
Also used : RemoteFile(com.instructure.canvasapi2.models.RemoteFile)

Aggregations

LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)59 Response (okhttp3.Response)57 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)28 ArrayList (java.util.ArrayList)27 Request (okhttp3.Request)27 List (java.util.List)22 Conversation (com.instructure.canvasapi2.models.Conversation)12 ParentResponse (com.instructure.canvasapi2.models.ParentResponse)10 RestParams (com.instructure.canvasapi2.builders.RestParams)8 GradingPeriodResponse (com.instructure.canvasapi2.models.GradingPeriodResponse)8 QuizSubmissionQuestionResponse (com.instructure.canvasapi2.models.QuizSubmissionQuestionResponse)8 QuizSubmissionResponse (com.instructure.canvasapi2.models.QuizSubmissionResponse)8 Submission (com.instructure.canvasapi2.models.Submission)7 Course (com.instructure.canvasapi2.models.Course)6 View (android.view.View)5 AdapterView (android.widget.AdapterView)5 TextView (android.widget.TextView)5 Assignment (com.instructure.canvasapi2.models.Assignment)5 CourseNickname (com.instructure.canvasapi2.models.CourseNickname)5 ImageView (android.widget.ImageView)4