Skip to content

Commit

Permalink
Fixed orientation button image in demo project.
Browse files Browse the repository at this point in the history
  • Loading branch information
gblancogarcia committed Jun 14, 2014
1 parent f1748bd commit 874efb6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
4388DC371801A3280074CABE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4388DC351801A3280074CABE /* InfoPlist.strings */; };
4388DC391801A3280074CABE /* GBInfiniteScrollViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4388DC381801A3280074CABE /* GBInfiniteScrollViewTests.m */; };
4388DC441801A3460074CABE /* GBInfiniteScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4388DC431801A3460074CABE /* GBInfiniteScrollView.m */; };
438EF525194C482D00756049 /* GBInfiniteScrollViewWithPageControl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 11279485194B800C008D22A2 /* GBInfiniteScrollViewWithPageControl.h */; };
438EF527194C484100756049 /* FXPageControl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 11279482194B800C008D22A2 /* FXPageControl.h */; };
43E7ABCE184C9CA4007211A5 /* GBInfiniteScrollViewPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43E7ABCD184C9CA4007211A5 /* GBInfiniteScrollViewPage.m */; };
43E7ABCF184CE0A8007211A5 /* GBInfiniteScrollViewPage.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 43E7ABCC184C9CA4007211A5 /* GBInfiniteScrollViewPage.h */; };
/* End PBXBuildFile section */
Expand All @@ -37,10 +39,12 @@
/* Begin PBXCopyFilesBuildPhase section */
4388DC171801A3280074CABE /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
buildActionMask = 12;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
438EF527194C484100756049 /* FXPageControl.h in CopyFiles */,
438EF525194C482D00756049 /* GBInfiniteScrollViewWithPageControl.h in CopyFiles */,
43E7ABCF184CE0A8007211A5 /* GBInfiniteScrollViewPage.h in CopyFiles */,
4357F3DF1801B3C700EF282B /* GBInfiniteScrollView.h in CopyFiles */,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ - (void)setUp
self.infiniteScrollView.interval = 3.0f;
self.infiniteScrollView.pageIndex = 0;
self.infiniteScrollView.autoScrollDirection = GBAutoScrollDirectionRightToLeft;
self.infiniteScrollView.scrollDirection = GBScrollDirectionHorizontal; //GBScrollDirectionVertical;
self.infiniteScrollView.scrollDirection = GBScrollDirectionHorizontal;

[self.view addSubview:self.infiniteScrollView];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#import "GBPageRecord.h"

static CGFloat const GBNumberOfPages = 1000.0f;
static CGFloat const GBNumberOfPages = 20.0f;
static CGFloat const GBMaxNumberOfPages = 10000.0f;

@interface GBViewController ()
Expand All @@ -25,8 +25,8 @@ @interface GBViewController ()
@property (nonatomic, strong) UIButton *addButton;
@property (nonatomic, strong) UIColor *color;
@property (nonatomic) GBAutoScrollDirection autoScrollDirection;
@property(nonatomic) CGAffineTransform rightToLeftTransform;
@property(nonatomic) CGAffineTransform leftToRightTransform;
@property(nonatomic) CGAffineTransform topToBottomTransform;
@property(nonatomic) CGAffineTransform bottomToTopTransform;
@property(nonatomic) BOOL debug;

@end
Expand Down Expand Up @@ -61,18 +61,19 @@ - (void)setUp
[self addRandomColorPage];
}

self.autoScrollDirection = GBAutoScrollDirectionBottomToTop;

self.infiniteScrollView = [[GBInfiniteScrollViewWithPageControl alloc] initWithFrame:self.view.bounds];
self.infiniteScrollView.infiniteScrollViewDataSource = self;
self.infiniteScrollView.infiniteScrollViewDelegate = self;
self.infiniteScrollView.debug = self.debug;
self.infiniteScrollView.verboseDebug = verboseDebug;
self.infiniteScrollView.interval = 3.0f;
self.infiniteScrollView.pageIndex = 0;
self.infiniteScrollView.autoScrollDirection = GBAutoScrollDirectionRightToLeft;

self.infiniteScrollView.scrollDirection = GBScrollDirectionVertical; //GBScrollDirectionHorizontal;
self.infiniteScrollView.autoScrollDirection = self.autoScrollDirection;
self.infiniteScrollView.scrollDirection = GBScrollDirectionVertical;

self.infiniteScrollView.pageControlPosition = GBPageControlPositionHorizontalBottom;
self.infiniteScrollView.pageControlPosition = GBPageControlPositionVerticalLeft;
[self.infiniteScrollView.pageControlViewContainer.pageControl setDotColor:[UIColor whiteColor]];

[self.view addSubview:self.infiniteScrollView];
Expand Down Expand Up @@ -127,9 +128,9 @@ - (void)setUpDirectionButton

[self.view addConstraint:left];

self.leftToRightTransform = self.directionButton.transform;
self.rightToLeftTransform = CGAffineTransformRotate(self.directionButton.transform, M_PI);
self.directionButton.transform = self.rightToLeftTransform;
self.bottomToTopTransform = self.directionButton.transform;
self.topToBottomTransform = CGAffineTransformRotate(self.directionButton.transform, M_PI);
self.directionButton.transform = self.bottomToTopTransform;
}

- (void)setUpInfoButton
Expand Down Expand Up @@ -297,12 +298,12 @@ - (void)switchDirection
CGAffineTransform transform;
GBAutoScrollDirection autoScrollDirection;

if (self.autoScrollDirection == GBAutoScrollDirectionLeftToRight) {
transform = self.rightToLeftTransform;
autoScrollDirection = GBAutoScrollDirectionRightToLeft;
} else if (self.autoScrollDirection == GBAutoScrollDirectionRightToLeft) {
transform = self.leftToRightTransform;
autoScrollDirection = GBAutoScrollDirectionLeftToRight;
if (self.autoScrollDirection == GBAutoScrollDirectionBottomToTop) {
transform = self.topToBottomTransform;
autoScrollDirection = GBAutoScrollDirectionTopToBottom;
} else if (self.autoScrollDirection == GBAutoScrollDirectionTopToBottom) {
transform = self.bottomToTopTransform;
autoScrollDirection = GBAutoScrollDirectionBottomToTop;
}

[UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 874efb6

Please sign in to comment.