- public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
- TextView date = Objects.requireNonNull(getActivity()).findViewById(R.id.new_transaction_date);
-
- final Calendar c = GregorianCalendar.getInstance();
- if ( c.get(GregorianCalendar.YEAR) == year && c.get(GregorianCalendar.MONTH) == monthOfYear) {
- date.setText(String.format(Locale.US, "%d", dayOfMonth));
- }
- else {
- date.setText(String.format(Locale.US, "%d/%d", monthOfYear+1, dayOfMonth));
- }
-
- TextView description = Objects.requireNonNull(getActivity())
- .findViewById(R.id.new_transaction_description);
- description.requestFocus();
-
+ public void onSelectedDayChange(@NonNull CalendarView view, int year, int month,
+ int dayOfMonth) {
+ updateDateInput(year, month, dayOfMonth);