use of com.lieverandiver.thesisproject.adapter.AttendanceInputAdapter in project classify-system by anverliedoit.
the class AttendanceInputActivity method init.
public void init() {
try {
hidesomthing = (CardView) findViewById(R.id.input_attendance_hide_save);
editTextName = (TextView) findViewById(R.id.input_attendance_name);
textViewDate = (TextView) findViewById(R.id.txtv_date3);
btnBack = (Button) findViewById(R.id.input_back3);
buttonSubmit = (Button) findViewById(btn_submit3_attendance);
btnSelectAll = (Button) findViewById(R.id.btn_selectall3);
recyclerViewStudentInput = (RecyclerView) findViewById(R.id.recyclerview_view3attendance);
cardmessage = (CardView) findViewById(R.id.card_message_status);
txMessageStatus = (TextView) findViewById(R.id.card_message_status_text);
rlDisruptor = (RelativeLayout) findViewById(R.id.disruptor_loading);
cardViewSucces = (CardView) findViewById(R.id.input_succes3);
cardViewFailed = (CardView) findViewById(R.id.input_failed3);
btnTryagain = (Button) findViewById(R.id.input_tryagain3);
btnOk = (Button) findViewById(R.id.input_ok3);
rlDisruptor.setVisibility(View.GONE);
cardViewSucces.setVisibility(View.GONE);
cardViewFailed.setVisibility(View.GONE);
for (Student s : classService.getStudentList(classId)) studentList.add(s);
attendanceInputAdapter = new AttendanceInputAdapter(this, studentList);
listener = attendanceInputAdapter;
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerViewStudentInput.setAdapter(attendanceInputAdapter);
recyclerViewStudentInput.setLayoutManager(layoutManager);
recyclerViewStudentInput.setItemAnimator(new DefaultItemAnimator());
String date = String.format(Locale.ENGLISH, "%02d/%02d/%d", Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + 1, Calendar.getInstance().get(Calendar.YEAR));
textViewDate.setText(date);
btnSelectAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onSelect(toggleMark);
if (toggleMark) {
btnSelectAll.setText("All unselect");
toggleMark = false;
} else {
btnSelectAll.setText("All select");
toggleMark = true;
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.lieverandiver.thesisproject.adapter.AttendanceInputAdapter in project classify-system by anverliedoit.
the class AttendanceInputActivityF method init.
public void init() {
try {
hidesomthing = (CardView) findViewById(R.id.input_attendance_hide_save);
editTextName = (TextView) findViewById(R.id.input_attendance_name);
textViewDate = (TextView) findViewById(R.id.txtv_date3);
btnBack = (Button) findViewById(R.id.input_back3);
buttonSubmit = (Button) findViewById(btn_submit3_attendance);
btnSelectAll = (Button) findViewById(R.id.btn_selectall3);
recyclerViewStudentInput = (RecyclerView) findViewById(R.id.recyclerview_view3attendance);
cardmessage = (CardView) findViewById(R.id.card_message_status);
txMessageStatus = (TextView) findViewById(R.id.card_message_status_text);
rlDisruptor = (RelativeLayout) findViewById(R.id.disruptor_loading);
cardViewSucces = (CardView) findViewById(R.id.input_succes3);
cardViewFailed = (CardView) findViewById(R.id.input_failed3);
btnTryagain = (Button) findViewById(R.id.input_tryagain3);
btnOk = (Button) findViewById(R.id.input_ok3);
rlDisruptor.setVisibility(View.GONE);
cardViewSucces.setVisibility(View.GONE);
cardViewFailed.setVisibility(View.GONE);
for (Student s : classService.getStudentList(classId)) studentList.add(s);
attendanceInputAdapter = new AttendanceInputAdapter(this, studentList);
listener = attendanceInputAdapter;
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerViewStudentInput.setAdapter(attendanceInputAdapter);
recyclerViewStudentInput.setLayoutManager(layoutManager);
recyclerViewStudentInput.setItemAnimator(new DefaultItemAnimator());
String date = String.format(Locale.ENGLISH, "%02d/%02d/%d", Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + 1, Calendar.getInstance().get(Calendar.YEAR));
textViewDate.setText(date);
btnSelectAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onSelect(toggleMark);
if (toggleMark) {
btnSelectAll.setText("All unselect");
toggleMark = false;
} else {
btnSelectAll.setText("All select");
toggleMark = true;
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations