Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CalendarDay Open #26

Closed
DantheCodingGui opened this issue Jul 9, 2019 · 2 comments · Fixed by #27
Closed

Make CalendarDay Open #26

DantheCodingGui opened this issue Jul 9, 2019 · 2 comments · Fixed by #27

Comments

@DantheCodingGui
Copy link

I'm running into a problem regarding selecting indates/outdates.

Using CalendarView.notifyDayChanged() I can show an indate/outdate as selected. Combining this with notifyDateChanged() when an indate/outdate is selected and you scroll to it's month, it is selected there as well.

The problem lies when you select a day in this month (ie. not an indate/outdate), if that date exists as an indate/outdate in another month, when you scroll to it, it won't be selected and there doesn't seem to be a way to do it.

I can think of getting this to work if when selecting any date, I call notifyDayChanged() with all 3 owners, but that would require the ability to instantiate new CalendarDay objects with the same LocalDate but different owners.

Is there an alternative way of doing this?,
thanks.

@kizitonwose
Copy link
Owner

Instead of making the CalendarDay class constructor public, version 0.2.2 allows you to optionally specify an owner when reloading a date:

fun notifyDateChanged(date: LocalDate, owner: DayOwner = DayOwner.THIS_MONTH)

The CalendarDay class can become more complex in the future, so it's important that it's only created internally.

@DantheCodingGui
Copy link
Author

Thanks! That should do the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants