Search in sources :

Example 1 with TeacherAdapter

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

the class ManageTeacherFragment method setTeacherListRecycleview.

private void setTeacherListRecycleview() {
    teacher_list_recyclerview.setHasFixedSize(true);
    teacher_list_recyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
    teacherAdapter = new TeacherAdapter(getActivity());
    teacher_list_recyclerview.setAdapter(teacherAdapter);
    manageTeacherViewModel.getMutableLiveData_manage_teacher_list().observe(getActivity(), new Observer<ArrayList<Teacher>>() {

        @Override
        public void onChanged(ArrayList<Teacher> teachers) {
            teacherAdapter.updateStudentList(teachers);
        }
    });
}
Also used : TeacherAdapter(com.shu.studentmanager.adpater.TeacherAdapter) ArrayList(java.util.ArrayList) Teacher(com.shu.studentmanager.entity.Teacher) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

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