prolificinteractive / material-calendarview

A Material design back port of Android's CalendarView
https://prolificinteractive.github.io/material-calendarview/
MIT License
5.91k stars 1.32k forks source link

Switching between week view and month view #1101

Open RakeshPatil111 opened 3 years ago

RakeshPatil111 commented 3 years ago

Hi, I want to switch between week view to month view and vice versa. Case 1 : Mode is Month View, and user scrolls up then it should switch to week view Case 2 : Mode is week view, and user scrolls down it should switch to month view. Thanks in advance

cmt218 commented 3 years ago

Hey @RakeshPatil111 I was able to achieve this like so:

User scrolls up: calendar.state().edit().setCalendarDisplayMode( CalendarMode.WEEKS ).commit()

User scrolls down: calendar.state().edit().setCalendarDisplayMode( CalendarMode.MONTHS ).commit()

making a clean transition between weeks and months is something I am currently trying to tackle though 😅