use of android.databinding.ObservableField in project open-event-orga-app by fossasia.
the class DateBindings method bindDate.
@BindingAdapter("date")
public static void bindDate(Button button, ObservableField<String> date) {
String format = DateUtils.FORMAT_DATE_COMPLETE;
bindTemporal(button, date, format, zonedDateTime -> new DatePickerDialog(button.getContext(), (picker, year, month, dayOfMonth) -> setPickedDate(LocalDateTime.of(LocalDate.of(year, month + 1, dayOfMonth), zonedDateTime.toLocalTime()), button, format, date), zonedDateTime.getYear(), zonedDateTime.getMonthValue() - 1, zonedDateTime.getDayOfMonth()));
}
use of android.databinding.ObservableField in project open-event-orga-app by fossasia.
the class DateBindings method bindTime.
@BindingAdapter("time")
public static void bindTime(Button button, ObservableField<String> time) {
String format = DateUtils.FORMAT_24H;
bindTemporal(button, time, format, zonedDateTime -> new TimePickerDialog(button.getContext(), (picker, hourOfDay, minute) -> setPickedDate(LocalDateTime.of(zonedDateTime.toLocalDate(), LocalTime.of(hourOfDay, minute)), button, format, time), zonedDateTime.getHour(), zonedDateTime.getMinute(), true));
}
Aggregations