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
Support for setting min and max dates #173
Conversation
Super! 👍 I'll take a look later! @alamkanak Are their guidelines yet about Pull Requests? |
@glennschmidt Can you rebase on develop, I'll take a look then, because it's a highly requested feature! |
Allows you to disable the infinite horizontal scrolling in one or both directions. Centralized the logic for calculating scroll limits into methods getYMinLimit(), getYMaxLimit(), getXMinLimit(), getXMaxLimit().
Calculate scroll limits and home date appropriately when min/max dates are set and numberOfVisibleDays > 1.
7259e9b
to
16771fd
Compare
Ok, done. |
I've switched to this fork and it's working flawlessly. +1 |
Hi, I'm very interrested on using this library with this feature. When is it intended to be included on the master branch? |
What happens with this pull? I need this too. :) |
👍 |
Oops, I totally forgot about this PR :( I'm so sorry, but @glennschmidt can you rebase onto master again? |
@glennschmidt Do you have to time to rebase this on the develop branch and fix the merge conflicts? This is a highly requested feature, see #6 and all duplicates referencing #6. |
I should get around to it this week. |
Hey everyone :) I also need this feature :) @glennschmidt can You tell us when will be this available please? |
Ola :) i would also appreciate this feature. @glennschmidt is it going to be merged or not? Just to know if to wait on that or go on. Thanks. |
I rebased that old commits to the master on my own. I found one issue there - when the period has length 28 days it is going weird. But for my purpose it is not a problem. Sorry, but for now I have no skills to pull and solve the collisions here on github. Old collision code is more less commented and marked by "//TODO". Could help so I decide to put it on pastebin at least: http://pastebin.com/8arLPBJ2 - thought better than keep it will be post it somewhere even in this state and way. |
This code is adapted from code written by @glennschmidt. The original code can be found in this pull request (alamkanak#173). This code was written to work with a newer version of Android-Week-View.
I've managed to get @glennschmidt code working with the latest version of develop with no conflicts. I will now open a pull request for this so that others can hopefully use this feature. |
Closing this in favor of #319 |
In case you are interested, I've implemented a feature for limiting the WeekView to a defined date range. This allows you to disable the infinite horizontal scrolling in one or both directions.
I think this makes the component more flexible, and useful in a range of situations. For example you could show a schedule of sessions that occur over a fixed period at a conference.
This feature has involved a few changes to the codebase, which can be broken down as follows:
mMinDate
andmMaxDate
which default to null (providing unrestricted scrolling by default)getMinDate()
,getMaxDate()
,setMinDate()
,setMaxDate()
mToday
and replace it withmHomeDate
, which is recalculated by a private methodresetHomeDate()
whenever certain properties change.getXMinLimit()
,getXMaxLimit()
,getYMinLimit()
andgetYMaxLimit()
getXOriginForDate()
onScroll()
,onFling()
andgoToDate()