use of com.instructure.speedgrader.fragments.MediaUploadFragment 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);
}
Aggregations