Skip to content

Commit 467d226

Browse files
committed
Fixed CCScrollView on iOS. Some iOS #ifs got moved inside of an Android one.
1 parent 0ff5020 commit 467d226

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

cocos2d-ui/CCScrollView.m

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,8 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni
751751
return (otherGestureRecognizer == _panRecognizer || otherGestureRecognizer == _tapRecognizer);
752752
}
753753

754-
#elif __CC_PLATFORM_ANDROID
755-
756754
- (void) onEnterTransitionDidFinish
757755
{
758-
#if __CC_PLATFORM_IOS
759756
// Add recognizers to view
760757
UIView* view = [CCDirector sharedDirector].view;
761758

@@ -765,22 +762,11 @@ - (void) onEnterTransitionDidFinish
765762
[recognizers insertObject:_tapRecognizer atIndex:0];
766763

767764
view.gestureRecognizers = recognizers;
768-
#elif __CC_PLATFORM_ANDROID
769-
dispatch_async(dispatch_get_main_queue(), ^{
770-
if(_detector)
771-
{
772-
[[[CCDirector sharedDirector] view] addGestureDetector:_detector];
773-
}
774-
});
775-
#endif
776765
[super onEnterTransitionDidFinish];
777766
}
778767

779-
780-
781768
- (void) onExitTransitionDidStart
782769
{
783-
#if __CC_PLATFORM_IOS
784770
// Remove recognizers from view
785771
UIView* view = [CCDirector sharedDirector].view;
786772

@@ -789,20 +775,35 @@ - (void) onExitTransitionDidStart
789775
[recognizers removeObject:_tapRecognizer];
790776

791777
view.gestureRecognizers = recognizers;
778+
779+
[super onExitTransitionDidStart];
780+
}
781+
792782
#elif __CC_PLATFORM_ANDROID
783+
784+
- (void) onEnterTransitionDidFinish
785+
{
786+
dispatch_async(dispatch_get_main_queue(), ^{
787+
if(_detector)
788+
{
789+
[[[CCDirector sharedDirector] view] addGestureDetector:_detector];
790+
}
791+
});
792+
[super onEnterTransitionDidFinish];
793+
}
794+
795+
- (void) onExitTransitionDidStart
796+
{
793797
dispatch_async(dispatch_get_main_queue(), ^{
794798
if(_detector)
795799
{
796800
[[[CCDirector sharedDirector] view] removeGestureDetector:_detector];
797801
}
798802
});
799-
#endif
800803

801804
[super onExitTransitionDidStart];
802805
}
803806

804-
805-
806807
- (CCTouchPhase)handleGestureEvent:(AndroidMotionEvent *)start end:(AndroidMotionEvent *)end
807808
{
808809
CCTouchPhase phase = CCTouchPhaseStationary;

0 commit comments

Comments
 (0)