Open csbenz opened 7 years ago
Experiencing this too. :(
Managed to workaround it with that:
private int lastMonth;
@Override
public void onDateSelected(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
if (calendar.get(Calendar.MONTH) != lastMonth) {
Date epochStart = new Date(0L);
for (int i = 0; i < 12; i++) {
MonthView monthView = lightCalendarView.getMonthViewForPosition(i);
if (monthView != null) monthView.setSelectedDate(epochStart);
}
lastMonth = calendar.get(Calendar.MONTH);
}
}
Same here.
Another workaround:
private Date mLastSelectedDate = Calendar.getInstance().getTime();
private void setCalendarView() {
mCalendarView.setOnStateUpdatedListener(new LightCalendarView.OnStateUpdatedListener() {
@Override
public void onMonthSelected(@NotNull Date date, @NotNull MonthView monthView) {
monthView.setSelectedDate(mLastSelectedDate);
}
@Override
public void onDateSelected(@NotNull Date date) {
mLastSelectedDate = date;
}
});
}
When I swipe to another month, select a day and come back to the initial month, the day is still selected. Is this a normal behaviour? Because it isn't intuitive and there's no way of unselecting the day. What I propose: when a day is clicked, all other days (there should be only one) are unselected.