use of com.lieverandiver.thesisproject.adapter.ActivityInputAdapter in project classify-system by anverliedoit.
the class ActivityInputActivity method init.
public void init() {
try {
editTextName = (EditText) findViewById(R.id.input_name1);
editTextTotal = (EditText) findViewById(R.id.input_total1);
textViewDate = (TextView) findViewById(R.id.input_date1);
buttonSubmit = (ToggleButton) findViewById(R.id.input_submit1);
btnBack = (Button) findViewById(R.id.input_back1);
dialogFailed = (CardView) findViewById(R.id.input_failed1);
dialogSucces = (CardView) findViewById(R.id.input_succes1);
btnOk = (Button) findViewById(R.id.input_ok1);
btnTryAgain = (Button) findViewById(input_tryagain1);
getDialogEmptyTotal = (CardView) findViewById(R.id.input_failedemp1);
getBtnTryAgainEmptyTotal = (Button) findViewById(R.id.input_tryagainemp1);
toggleButtonhideandshow = (ToggleButton) findViewById(R.id.input_hideandshow1);
frameLayouthideandshow = (FrameLayout) findViewById(R.id.input_detailts1);
toggleButtonhideandshow.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
frameLayouthideandshow.setVisibility(View.GONE);
} else {
frameLayouthideandshow.setVisibility(View.VISIBLE);
}
}
});
getDialogEmptyTotal.setVisibility(View.GONE);
dialogSucces.setVisibility(View.GONE);
dialogFailed.setVisibility(View.GONE);
btnOk.setOnClickListener(this);
btnBack.setOnClickListener(this);
buttonSubmit.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
buttonSubmit.setVisibility(View.GONE);
}
}
});
getBtnTryAgainEmptyTotal.setOnClickListener(this);
btnTryAgain.setOnClickListener(this);
recyclerViewStudentInput = (RecyclerView) findViewById(R.id.input_recyclerview1);
recyclerViewStudentInput.setVisibility(View.VISIBLE);
for (Student s : classService.getStudentList(getIntent().getExtras().getLong("classId"))) studentList.add(s);
studentAdapter = new ActivityInputAdapter(this, studentList);
recyclerViewStudentInput.setAdapter(studentAdapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
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);
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.lieverandiver.thesisproject.adapter.ActivityInputAdapter in project classify-system by anverliedoit.
the class ActivityInputActivity2 method init.
public void init() {
try {
editTextName = (EditText) findViewById(R.id.input_name1);
editTextTotal = (EditText) findViewById(R.id.input_total1);
textViewDate = (TextView) findViewById(R.id.input_date1);
buttonSubmit = (ToggleButton) findViewById(R.id.input_submit1);
btnBack = (Button) findViewById(R.id.input_back1);
dialogFailed = (CardView) findViewById(R.id.input_failed1);
dialogSucces = (CardView) findViewById(R.id.input_succes1);
btnOk = (Button) findViewById(R.id.input_ok1);
btnTryAgain = (Button) findViewById(input_tryagain1);
getDialogEmptyTotal = (CardView) findViewById(R.id.input_failedemp1);
getBtnTryAgainEmptyTotal = (Button) findViewById(R.id.input_tryagainemp1);
toggleButtonhideandshow = (ToggleButton) findViewById(R.id.input_hideandshow1);
frameLayouthideandshow = (FrameLayout) findViewById(R.id.input_detailts1);
toggleButtonhideandshow.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
frameLayouthideandshow.setVisibility(View.GONE);
} else {
frameLayouthideandshow.setVisibility(View.VISIBLE);
}
}
});
getDialogEmptyTotal.setVisibility(View.GONE);
dialogSucces.setVisibility(View.GONE);
dialogFailed.setVisibility(View.GONE);
btnOk.setOnClickListener(this);
btnBack.setOnClickListener(this);
buttonSubmit.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
buttonSubmit.setVisibility(View.GONE);
}
}
});
getBtnTryAgainEmptyTotal.setOnClickListener(this);
btnTryAgain.setOnClickListener(this);
recyclerViewStudentInput = (RecyclerView) findViewById(R.id.input_recyclerview1);
recyclerViewStudentInput.setVisibility(View.VISIBLE);
for (Student s : classService.getStudentList(getIntent().getExtras().getLong("classId"))) studentList.add(s);
studentAdapter = new ActivityInputAdapter(this, studentList);
recyclerViewStudentInput.setAdapter(studentAdapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
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);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations