use of com.shu.studentmanager.adpater.CourseAdapter in project student-manager by SYYANI.
the class TeacherFragment method setCoureListRecycleView.
private void setCoureListRecycleView() {
course_list_recycleview.setHasFixedSize(true);
course_list_recycleview.setLayoutManager(new LinearLayoutManager(getActivity()));
courseAdapter = new CourseAdapter(getActivity());
course_list_recycleview.setAdapter(courseAdapter);
teacherViewModel.getMutableLiveData_course_list().observe(getActivity(), new Observer<ArrayList<CourseTeacher>>() {
@Override
public void onChanged(ArrayList<CourseTeacher> courseTeachers) {
// Log.d(TAG, "onChanged: update");
teacherFragmentBinding.teacherFragmentTeacherClassNumber.setText("本学期开设 " + String.valueOf(courseTeachers.size()) + " 门课");
courseAdapter.updateCourseList(courseTeachers);
}
});
}
Aggregations