Skip to content
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

Make scrolling to next or previous page animatable. #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions JTCalendar/Protocols/JTContent.h
Expand Up @@ -19,7 +19,7 @@
- (void)loadPreviousPage;
- (void)loadNextPage;

- (void)loadPreviousPageWithAnimation;
- (void)loadNextPageWithAnimation;
- (void)loadPreviousPage:(BOOL)animated;
- (void)loadNextPage:(BOOL)animated;

@end
8 changes: 4 additions & 4 deletions JTCalendar/Views/JTHorizontalCalendarView.m
Expand Up @@ -128,7 +128,7 @@ - (void)viewDidScroll
[_manager.scrollManager updateMenuContentOffset:(self.contentOffset.x / self.contentSize.width) pageMode:_pageMode];
}

- (void)loadPreviousPageWithAnimation
- (void)loadPreviousPage:(BOOL)animated
{
switch (_pageMode) {
case JTCalendarPageModeCenterRight:
Expand All @@ -140,10 +140,10 @@ - (void)loadPreviousPageWithAnimation

CGSize size = self.frame.size;
CGPoint point = CGPointMake(self.contentOffset.x - size.width, 0);
[self setContentOffset:point animated:YES];
[self setContentOffset:point animated:animated];
}

- (void)loadNextPageWithAnimation
- (void)loadNextPage:(BOOL)animated
{
switch (_pageMode) {
case JTCalendarPageModeCenterLeft:
Expand All @@ -155,7 +155,7 @@ - (void)loadNextPageWithAnimation

CGSize size = self.frame.size;
CGPoint point = CGPointMake(self.contentOffset.x + size.width, 0);
[self setContentOffset:point animated:YES];
[self setContentOffset:point animated:animated];
}

- (void)loadPreviousPage
Expand Down
8 changes: 4 additions & 4 deletions JTCalendar/Views/JTVerticalCalendarView.m
Expand Up @@ -128,7 +128,7 @@ - (void)viewDidScroll
[_manager.scrollManager updateMenuContentOffset:(self.contentOffset.y / self.contentSize.height) pageMode:_pageMode];
}

- (void)loadPreviousPageWithAnimation
- (void)loadPreviousPage:(BOOL)animated
{
switch (_pageMode) {
case JTCalendarPageModeCenterRight:
Expand All @@ -140,10 +140,10 @@ - (void)loadPreviousPageWithAnimation

CGSize size = self.frame.size;
CGPoint point = CGPointMake(0, self.contentOffset.y - size.height);
[self setContentOffset:point animated:YES];
[self setContentOffset:point animated:animated];
}

- (void)loadNextPageWithAnimation
- (void)loadNextPage:(BOOL)animated
{
switch (_pageMode) {
case JTCalendarPageModeCenterLeft:
Expand All @@ -155,7 +155,7 @@ - (void)loadNextPageWithAnimation

CGSize size = self.frame.size;
CGPoint point = CGPointMake(0, self.contentOffset.y + size.height);
[self setContentOffset:point animated:YES];
[self setContentOffset:point animated:animated];
}

- (void)loadPreviousPage
Expand Down