use of com.shu.studentmanager.adpater.StudentCourseAdapter in project student-manager by SYYANI.
the class StudentFragment method setStudentCoureListRecycleView.
private void setStudentCoureListRecycleView() {
student_course_list_recyclerview.setHasFixedSize(true);
student_course_list_recyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
studentCourseAdapter = new StudentCourseAdapter(getActivity());
student_course_list_recyclerview.setAdapter(studentCourseAdapter);
// studentViewModel.get
studentViewModel.getMutableLiveData_student_course_list().observe(getActivity(), new Observer<ArrayList<CourseStudent>>() {
@Override
public void onChanged(ArrayList<CourseStudent> courseStudents) {
// Log.d(TAG, "onChanged: update");
studentFragmentBinding.studentFragmentStudentClassNumber.setText("本学期共有 " + String.valueOf(courseStudents.size()) + " 门课");
studentCourseAdapter.updateCourseList(courseStudents);
}
});
}
Aggregations