-
Notifications
You must be signed in to change notification settings - Fork 22
Allow user to specify an end page #4
Comments
That should not be too difficult to implement. I would add two more methods setMaxValue(T value) and setMinValue(T value) in the InfiniteAdapter Class. And if your current indicator value is either of those two values the pager should stop. But that's just an idea. I haven't thought it through ;) I will start implementing this feature tonight. cheers |
Awesome! That would be a huge help! |
Have you implemented this feature yet, hayribakici? I was working on the very same feature and I stumbled into this issue page. I was curious if the work is already done. Or I could contribute my work otherwise. :) The basic idea is to have a left or right bound of T type. If it is bounded and has reached to a left or right bound, then do not allow users to move beyond the bound. To achieve this behaviour, the indicator needs to be Comparable rather than T because we want to compare the current indicator against the left or right bound value to determine when to stop. I also had to handle special cases where users can set the current indicator which may end up on the exact left or right bound. I'm just finishing up my work so it could be ready in a couple of days. SP |
hi, |
I wasn't aware that the Date or Time class in android doesn't implement the comparable interface. I'm new to java and android. I guess one could still use it with milliseconds value if it provides such a function. Having said that, it can be done without the comparable interface. I'm thinking the string representation of min/max indicators. I'm going to give this a try. Or do you have any suggestions? |
Hi, |
@Wavesonics @seulkiro @hayribakici Anyone made any progress adding bounds? I would be interested in this feature as well! |
@henrykvdb there is a branch feature/max_min_value, however I was thinking what the use case would be, when setting a maximum or minimum value? |
@hayribakici I don't see how setting a lower OR upper bound would not make it an infiniteViewPager, as there would still be infinite pages. You only get a regular ViewPager when you add an upper and lower bound at the same time. |
It would be very helpful to allow users of the lib to be able to specify if a particular page is the last page in that direction.
My use case is I want to have infinite paging to the right, but not be able to go back to the left beyond a certain point.
I may actually take a crack at adding this my self, any tips on where to look in code to implement something like this?
The text was updated successfully, but these errors were encountered: