use of com.instructure.speedgrader.adapters.FilesAdapter in project instructure-android by instructure.
the class RubricHeaderViewHolder method populateAttachments.
private void populateAttachments(ArrayList<Attachment> attachments) {
FilesAdapter fileAdapter = new FilesAdapter(mContext, R.layout.rubric_spinner_item, attachments);
fileSpinner.setAdapter(fileAdapter);
if (currentAttachment != null) {
setAttachmentSelectionById(currentAttachment.getId());
}
}
use of com.instructure.speedgrader.adapters.FilesAdapter in project instructure-android by instructure.
the class RubricHeaderViewHolder method getFileSelectListener.
private AdapterView.OnItemSelectedListener getFileSelectListener() {
return new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// firstSelectEventFired is a workaround to stop these premature calls to our interface.
if (firstSelectAttachmentEventFired) {
Attachment attachment = ((FilesAdapter) fileSpinner.getAdapter()).getItem(position);
mSubmissionListener.onAttachmentSelected(attachment, mSubmission);
} else {
firstSelectAttachmentEventFired = true;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
}
Aggregations