use of org.eyeseetea.malariacare.views.DatePickerFragment in project pictureapp by EyeSeeTea.
the class NewReceiptBalanceFragment method initViews.
private void initViews(View view) {
date = (TextView) view.findViewById(R.id.new_receipt_balance_date);
rdt = (EditText) view.findViewById(R.id.new_receipt_balance_rdt);
act6 = (EditText) view.findViewById(R.id.new_receipt_balance_act6);
act12 = (EditText) view.findViewById(R.id.new_receipt_balance_act12);
act18 = (EditText) view.findViewById(R.id.new_receipt_balance_act18);
act24 = (EditText) view.findViewById(R.id.new_receipt_balance_act24);
pq = (EditText) view.findViewById(R.id.new_receipt_balance_pq);
cq = (EditText) view.findViewById(R.id.new_receipt_balance_cq);
putTodayDate();
view.findViewById(R.id.new_receipt_balance_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
backPressed();
}
});
view.findViewById(R.id.new_receipt_balance_submit).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
submitPressed();
}
});
final DatePickerFragment datePickerFragment = new DatePickerFragment();
datePickerFragment.setOnDateSetListener(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
NumberFormat formatter = new DecimalFormat("00");
date.setText(year + "/" + formatter.format(monthOfYear) + "/" + formatter.format(dayOfMonth));
}
});
date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
datePickerFragment.show(getFragmentManager(), TAG);
}
});
}
Aggregations