Search in sources :

Example 1 with BaseSubmissionView

use of com.instructure.speedgrader.fragments.BaseSubmissionView in project instructure-android by instructure.

the class DocumentActivity method onAttachmentSelected.

// endregion
// /////////////////////////////////////////////////////////////////////////
// Interface Methods
// /////////////////////////////////////////////////////////////////////////
@Override
public void onAttachmentSelected(Attachment attachment, Submission submission) {
    if (mAdapter == null || mViewpager == null) {
        return;
    }
    currentAttachment = attachment;
    final String submissionType = submission.getSubmissionType();
    if (submissionType != null && submissionType.equals(onlineURL)) {
        final OnlineURLFragment urlFragment = (OnlineURLFragment) mAdapter.getCachedFragment(mViewpager.getCurrentItem());
        urlFragment.setUrlAttachment(attachment, submission.getUrl());
    } else if (submissionType != null && submissionType.equals(mediaUpload)) {
        final MediaUploadFragment mediaUploadFragment = (MediaUploadFragment) mAdapter.getCachedFragment(mViewpager.getCurrentItem());
        mediaUploadFragment.loadMedia(submission);
    } else {
        final SubmissionWebViewFragment webViewFragment = (SubmissionWebViewFragment) mAdapter.getCachedFragment(mViewpager.getCurrentItem());
        webViewFragment.displayAttachment(attachment);
    }
    ((BaseSubmissionView) mAdapter.getCachedFragment(mViewpager.getCurrentItem())).setAttachment(attachment);
}
Also used : SubmissionWebViewFragment(com.instructure.speedgrader.fragments.SubmissionWebViewFragment) BaseSubmissionView(com.instructure.speedgrader.fragments.BaseSubmissionView) OnlineURLFragment(com.instructure.speedgrader.fragments.OnlineURLFragment) MediaUploadFragment(com.instructure.speedgrader.fragments.MediaUploadFragment)

Example 2 with BaseSubmissionView

use of com.instructure.speedgrader.fragments.BaseSubmissionView in project instructure-android by instructure.

the class DocumentActivity method onSubmissionCommentsUpdated.

@Override
public void onSubmissionCommentsUpdated(Submission submission) {
    if (mAdapter == null || mViewpager == null) {
        return;
    }
    final ArrayList<SubmissionComment> comments = submission.getComments();
    mSubmissionsList.get(mViewpager.getCurrentItem()).setComments(comments);
    final BaseSubmissionView fragment = (BaseSubmissionView) mAdapter.getItem(mViewpager.getCurrentItem());
    fragment.submission.setComments(comments);
}
Also used : BaseSubmissionView(com.instructure.speedgrader.fragments.BaseSubmissionView) SubmissionComment(com.instructure.canvasapi.model.SubmissionComment)

Example 3 with BaseSubmissionView

use of com.instructure.speedgrader.fragments.BaseSubmissionView in project instructure-android by instructure.

the class DocumentActivity method onSubmissionRubricAssessmentUpdated.

@Override
public void onSubmissionRubricAssessmentUpdated(HashMap<String, RubricCriterionRating> newRatings, Double newScore, String newGrade) {
    mSubmissionsList.get(mViewpager.getCurrentItem()).setRubricAssessment(newRatings);
    mSubmissionsList.get(mViewpager.getCurrentItem()).setScore(newScore);
    mSubmissionsList.get(mViewpager.getCurrentItem()).setGrade(newGrade);
    mPopupWindow.notifyDataSetChanged();
    final BaseSubmissionView fragment = (BaseSubmissionView) mAdapter.getItem(mViewpager.getCurrentItem());
    fragment.submission.setRubricAssessment(newRatings);
    fragment.submission.setScore(newScore);
    fragment.submission.setGrade(newGrade);
}
Also used : BaseSubmissionView(com.instructure.speedgrader.fragments.BaseSubmissionView)

Aggregations

BaseSubmissionView (com.instructure.speedgrader.fragments.BaseSubmissionView)3 SubmissionComment (com.instructure.canvasapi.model.SubmissionComment)1 MediaUploadFragment (com.instructure.speedgrader.fragments.MediaUploadFragment)1 OnlineURLFragment (com.instructure.speedgrader.fragments.OnlineURLFragment)1 SubmissionWebViewFragment (com.instructure.speedgrader.fragments.SubmissionWebViewFragment)1