use of com.instructure.candroid.adapter.FileUploadCoursesAdapter in project instructure-android by instructure.
the class ShareFileDestinationDialog method setupCourseSpinners.
private void setupCourseSpinners() {
if (studentEnrollmentsAdapter == null) {
studentEnrollmentsAdapter = new FileUploadCoursesAdapter(getActivity(), getActivity().getLayoutInflater(), FileUploadCoursesAdapter.getFilteredCourseList(courses, FileUploadCoursesAdapter.Type.STUDENT));
studentCoursesSpinner.setAdapter(studentEnrollmentsAdapter);
} else {
studentEnrollmentsAdapter.setCourses(FileUploadCoursesAdapter.getFilteredCourseList(courses, FileUploadCoursesAdapter.Type.STUDENT));
}
studentCoursesSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// make the allowed extensions disappear
Course course = (Course) parent.getAdapter().getItem(position);
// if the user is a teacher, let them know and don't let them select an assignment
if (course.getId() > 0) {
setAssignmentsSpinnerToLoading();
AssignmentManager.getAllAssignments(course.getId(), false, canvasCallbackAssignments);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
Aggregations