Search in sources :

Example 1 with CanvasContext

use of com.instructure.canvasapi.model.CanvasContext in project instructure-android by instructure.

the class CourseListFragment method onRowClick.

@Override
public boolean onRowClick(CanvasContext item) {
    Bundle bundle = new Bundle();
    Section section = (Section) item;
    section.getCourse_id();
    CanvasContext course = courseGroupMap.get(section.getCourse_id());
    bundle.putParcelable(Const.SECTION, item);
    bundle.putParcelable(Const.COURSE, course);
    bundle.putParcelableArrayList(Const.SECTION_PEOPLE, (ArrayList<User>) ((Section) item).getStudents());
    if (nextFragment == Const.HOT_SEAT) {
        StudentChooserFragment studentChooserFragment = new StudentChooserFragment();
        studentChooserFragment.setArguments(bundle);
        getParentActivity().swapFragment(studentChooserFragment, StudentChooserFragment.TAG);
    } else if (nextFragment == Const.GUESS_WHO) {
        GuessWhoFragment guessWhoFragment = new GuessWhoFragment();
        guessWhoFragment.setArguments(bundle);
        getParentActivity().swapFragment(guessWhoFragment, GuessWhoFragment.TAG);
    } else if (nextFragment == Const.STUDENT_NOTES) {
        StudentNotesFragment studentNotesFragment = new StudentNotesFragment();
        studentNotesFragment.setArguments(bundle);
        getParentActivity().swapFragment(studentNotesFragment, StudentNotesFragment.TAG);
    }
    return true;
}
Also used : User(com.instructure.canvasapi.model.User) Bundle(android.os.Bundle) CanvasContext(com.instructure.canvasapi.model.CanvasContext) Section(com.instructure.canvasapi.model.Section)

Aggregations

Bundle (android.os.Bundle)1 CanvasContext (com.instructure.canvasapi.model.CanvasContext)1 Section (com.instructure.canvasapi.model.Section)1 User (com.instructure.canvasapi.model.User)1