Search in sources :

Example 1 with StudentAdapter

use of com.shu.studentmanager.adpater.StudentAdapter in project student-manager by SYYANI.

the class ManageStudentFragment method setStudentListRecycleview.

private void setStudentListRecycleview() {
    student_list_recyclerview.setHasFixedSize(true);
    student_list_recyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
    studentAdapter = new StudentAdapter(getActivity());
    student_list_recyclerview.setAdapter(studentAdapter);
    manageStudentViewModel.getMutableLiveData_manage_student_list().observe(getActivity(), new Observer<ArrayList<Student>>() {

        @Override
        public void onChanged(ArrayList<Student> students) {
            studentAdapter.updateStudentList(students);
        }
    });
}
Also used : StudentAdapter(com.shu.studentmanager.adpater.StudentAdapter) ArrayList(java.util.ArrayList) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) Student(com.shu.studentmanager.entity.Student)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 StudentAdapter (com.shu.studentmanager.adpater.StudentAdapter)1 Student (com.shu.studentmanager.entity.Student)1 ArrayList (java.util.ArrayList)1