Want Vertical Scroll on month view to switch to week view and vice versa
See original GitHub issueHi, I’m trying to implement switching from week view to month view and vice versa on vertical scroll I implemented the same by using the parent scroll view in but I want the switching to happen only on scrolling inside the calendar view not on the whole layout. Following is my code for implementing my requirement in parent scroll view Thanks
weekCalendarView.isVisible = false
scrollView.setOnScrollChangeListener(View.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
val x = scrollY - oldScrollY
if (x > 0) {
//scroll down
//week to month
monthCalendarView.isVisible = false
weekCalendarView.requestLayout()
weekCalendarView.scrollToDate(selectedDate!!)
weekCalendarView.isVisible = true
}
if (x < 0) {
//scroll up
//month to week
weekCalendarView.isVisible = false
monthCalendarView.requestLayout()
monthCalendarView.scrollToMonth(selectedDate!!.yearMonth)
monthCalendarView.isVisible = true
}
})
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Scroll google calendar month view one week at a time, to ...
Pressing w switches to 1-week view, then pressing p or n steps back (previous) or forward (next) 1 week, then pressing x switches...
Read more >Google preps vertical scrolling in Calendar's month view
The new interface aligns more closely with the schedule view that scrolls vertically, too, and might thus make navigating months more intuitive.
Read more >Video: Calendar views - Microsoft Support
Training: In this video, learn how to get a handle on your schedule by changing your calendar view and even your minimum meeting...
Read more >How to change Month View to Week View vice versa for ...
In a weekView mode, it has 1 row. So when you want to change the mode you change numberOfRows and reload calendarView and...
Read more >Calendar Vertical Scroll? - Google Help
It's not such a big deal to me because I typically keep my calendar in the week view and only rarely need to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If your solution is already working properly but you need it to happen outside the calendar view, then you can:
true
, else set it to false.true
.There are some things wrong in your code like setting view visibility, and calling
scrollToMonth()
insideupdateLayoutParams()
. You have to figure out what you are not doing right. The previous discussions should guide you as I cannot provide specific help without access to the app code to see what exactly is happening.