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);
}
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);
}
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);
}
Aggregations