@@ -116,6 +116,41 @@ - (void)commonInit
116
116
_contentViewScaleValue = 0 .7f ;
117
117
}
118
118
119
+ #pragma mark -
120
+ #pragma mark Getters (Simple mode)
121
+
122
+ - (BOOL )scaleContentView
123
+ {
124
+ if (self.simpleMode ) {
125
+ return NO ;
126
+ }
127
+ return _scaleContentView;
128
+ }
129
+
130
+ - (BOOL )scaleMenuView
131
+ {
132
+ if (self.simpleMode ) {
133
+ return NO ;
134
+ }
135
+ return _scaleMenuView;
136
+ }
137
+
138
+ - (BOOL )scaleBackgroundImageView
139
+ {
140
+ if (self.simpleMode ) {
141
+ return NO ;
142
+ }
143
+ return _scaleBackgroundImageView;
144
+ }
145
+
146
+ - (BOOL )parallaxEnabled
147
+ {
148
+ if (self.simpleMode ) {
149
+ return NO ;
150
+ }
151
+ return _parallaxEnabled;
152
+ }
153
+
119
154
#pragma mark -
120
155
#pragma mark Public methods
121
156
@@ -566,9 +601,14 @@ - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer
566
601
}
567
602
568
603
if (recognizer.state == UIGestureRecognizerStateChanged) {
604
+ CGFloat contentOffset = UIInterfaceOrientationIsLandscape ([[UIApplication sharedApplication ] statusBarOrientation ]) ? self.contentViewInLandscapeOffsetCenterX : self.contentViewInPortraitOffsetCenterX ;
605
+ CGFloat maxPanWidth = self.contentViewContainer .bounds .size .width /2 + contentOffset;
606
+
569
607
CGFloat delta = 0 ;
570
608
if (self.visible ) {
571
609
delta = self.originalPoint .x != 0 ? (point.x + self.originalPoint .x ) / self.originalPoint .x : 0 ;
610
+ } else if (self.simpleMode ) {
611
+ delta = point.x / maxPanWidth;
572
612
} else {
573
613
delta = point.x / self.view .frame .size .width ;
574
614
}
@@ -616,6 +656,27 @@ - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer
616
656
} else {
617
657
point.x = MIN (point.x , [UIScreen mainScreen ].bounds .size .height );
618
658
}
659
+ if (self.simpleMode ) {
660
+ if (self.leftMenuVisible && self.rightMenuVisible ) {
661
+ NSAssert (FALSE , @" WARNING: both left and right menu visible" );
662
+ } else if (self.leftMenuVisible ) {
663
+ if (point.x > 0 ) {
664
+ point.x = 0 ;
665
+ } else if (point.x < -maxPanWidth) {
666
+ point.x = -maxPanWidth;
667
+ }
668
+ } else if (self.rightMenuVisible ) {
669
+ if (point.x < 0 ) {
670
+ point.x = 0 ;
671
+ } else if (point.x > maxPanWidth) {
672
+ point.x = maxPanWidth;
673
+ }
674
+ } else if (point.x < -maxPanWidth){
675
+ point.x = -maxPanWidth;
676
+ } else if (point.x > maxPanWidth) {
677
+ point.x = maxPanWidth;
678
+ }
679
+ }
619
680
[recognizer setTranslation: point inView: self .view];
620
681
621
682
if (!self.didNotifyDelegate ) {
0 commit comments