realityexpander / Tasky

Task manager similar to a lite version of Google Calendar
141 stars 12 forks source link

0025-add-agenda-date-picker-2 #27

Closed realityexpander closed 1 year ago

realityexpander commented 1 year ago

Question 1

Is this a good way to handle combining two flows?

https://github.com/realityexpander/Tasky/blob/39dabd036e19bc9b7250332e66e390f6822c4761/app/src/main/java/com/realityexpander/tasky/agenda_feature/presentation/agenda_screen/AgendaViewModel.kt#L49-L57

realityexpander commented 1 year ago

Follow up reply

Just one thing that isn't clear to me in that block is why getDateForSelectedDateIndex() is needed. If agendaRepository.getAgendaForDayFlow() takes in a date, why can't you just pass _currentDate? Not sure if currentDate reflects the current or selected date for you. If it reflects the current one, it doesn't seem to be needed as a state, since you can always get that using LocalDate.now()

Because I have a "anchor" date that is the start of the week for the agendaScreen, then I have a selector that sets the "index day". This makes handling the UI very straightforward.