@@ -117,6 +117,41 @@ - (void)commonInit
117117 _contentViewScaleValue = 0 .7f ;
118118}
119119
120+ #pragma mark -
121+ #pragma mark Getters (Simple mode)
122+
123+ - (BOOL )scaleContentView
124+ {
125+ if (self.simpleMode ) {
126+ return NO ;
127+ }
128+ return _scaleContentView;
129+ }
130+
131+ - (BOOL )scaleMenuView
132+ {
133+ if (self.simpleMode ) {
134+ return NO ;
135+ }
136+ return _scaleMenuView;
137+ }
138+
139+ - (BOOL )scaleBackgroundImageView
140+ {
141+ if (self.simpleMode ) {
142+ return NO ;
143+ }
144+ return _scaleBackgroundImageView;
145+ }
146+
147+ - (BOOL )parallaxEnabled
148+ {
149+ if (self.simpleMode ) {
150+ return NO ;
151+ }
152+ return _parallaxEnabled;
153+ }
154+
120155#pragma mark -
121156#pragma mark Public methods
122157
@@ -571,9 +606,14 @@ - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer
571606 }
572607
573608 if (recognizer.state == UIGestureRecognizerStateChanged) {
609+ CGFloat contentOffset = UIInterfaceOrientationIsLandscape ([[UIApplication sharedApplication ] statusBarOrientation ]) ? self.contentViewInLandscapeOffsetCenterX : self.contentViewInPortraitOffsetCenterX ;
610+ CGFloat maxPanWidth = self.contentViewContainer .bounds .size .width /2 + contentOffset;
611+
574612 CGFloat delta = 0 ;
575613 if (self.visible ) {
576614 delta = self.originalPoint .x != 0 ? (point.x + self.originalPoint .x ) / self.originalPoint .x : 0 ;
615+ } else if (self.simpleMode ) {
616+ delta = point.x / maxPanWidth;
577617 } else {
578618 delta = point.x / self.view .frame .size .width ;
579619 }
@@ -622,6 +662,27 @@ - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer
622662 } else {
623663 point.x = MIN (point.x , [UIScreen mainScreen ].bounds .size .height );
624664 }
665+ if (self.simpleMode ) {
666+ if (self.leftMenuVisible && self.rightMenuVisible ) {
667+ NSAssert (FALSE , @" WARNING: both left and right menu visible" );
668+ } else if (self.leftMenuVisible ) {
669+ if (point.x > 0 ) {
670+ point.x = 0 ;
671+ } else if (point.x < -maxPanWidth) {
672+ point.x = -maxPanWidth;
673+ }
674+ } else if (self.rightMenuVisible ) {
675+ if (point.x < 0 ) {
676+ point.x = 0 ;
677+ } else if (point.x > maxPanWidth) {
678+ point.x = maxPanWidth;
679+ }
680+ } else if (point.x < -maxPanWidth){
681+ point.x = -maxPanWidth;
682+ } else if (point.x > maxPanWidth) {
683+ point.x = maxPanWidth;
684+ }
685+ }
625686 [recognizer setTranslation: point inView: self .view];
626687
627688 if (!self.didNotifyDelegate ) {
0 commit comments