use of com.lieverandiver.thesisproject.adapter.SubjectAdapter in project classify-system by anverliedoit.
the class TeacherViewActivity method init.
private void init() {
txtName = (TextView) findViewById(R.id.txtv_fullname);
txtDept = (TextView) findViewById(R.id.txtv_dept);
btnBack = (Button) findViewById(R.id.add_backsubject);
rView = (RecyclerView) findViewById(R.id.recyclerview_view_subject);
try {
SubjectAdapter subjectAdapter = new SubjectAdapter(this, subjectService.getSubjectListByTeacherIdUnique(teacher.getId()));
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
rView.setAdapter(subjectAdapter);
rView.setLayoutManager(layoutManager);
rView.setItemAnimator(new DefaultItemAnimator());
txtName.setText(teacher.getFirstName() + " " + teacher.getMiddleName().substring(0, 1) + ". " + teacher.getLastName());
txtDept.setText(teacher.getDepartment() != null ? teacher.getDepartment().getName() : "None");
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
finish();
}
});
} catch (SubjectException e) {
e.printStackTrace();
}
}
use of com.lieverandiver.thesisproject.adapter.SubjectAdapter in project classify-system by anverliedoit.
the class Teacher_Activity_Teacher_Profile method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TeacherServiceImpl teacherService = new TeacherServiceImpl();
Teacher teacher;
try {
teacher = teacherService.getTeacherById(getIntent().getExtras().getLong("teacherId"));
} catch (Exception e) {
e.printStackTrace();
teacher = new Teacher();
}
setContentView(R.layout.teacher_activity_view_teacher_profile);
txtvName = (TextView) findViewById(R.id.txtv_fullname);
txtvDept = (TextView) findViewById(R.id.txtv_dept);
buttonback = (Button) findViewById(R.id.add_backsubject);
recyclerView = (RecyclerView) findViewById(R.id.recyclerview_view_subject);
SubjectServiceImpl subjectService = new SubjectServiceImpl();
SubjectAdapter subjectAdapter = null;
try {
subjectAdapter = new SubjectAdapter(this, subjectService.getSubjectListByTeacherId(teacher.getId()));
} catch (SubjectException e) {
e.printStackTrace();
}
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setAdapter(subjectAdapter);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
txtvName.setText(teacher.getFirstName() + " " + teacher.getMiddleName().substring(0, 1) + ". " + teacher.getLastName());
txtvDept.setText(teacher.getDepartment() != null ? teacher.getDepartment().getName() : "None");
buttonback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
finish();
}
});
}
Aggregations