Permalink
Browse files

Add slide from top gestures

  • Loading branch information...
1 parent 35597e7 commit 0d0ce63fe5f8582877a49feb4a69cb70764d3130 @rpetrich committed Dec 26, 2011
View
@@ -160,6 +160,16 @@ static inline BOOL SlideGestureStartWithRotatedLocation(CGPoint location)
rectToEnterToSendSlideGesture = (CGRect){ { 0.0f, 0.0f }, { screenSize.width, screenSize.height - (kSlideGestureWindowHeight + 50.0f) }};
return YES;
}
+ if (location.y < kSlideGestureWindowHeight) {
+ if (location.x < screenSize.width * 0.25f)
+ startedSlideGestureName = LAEventNameSlideInFromTopLeft;
+ else if (location.x < screenSize.width * 0.75f)
+ startedSlideGestureName = LAEventNameSlideInFromTop;
+ else
+ startedSlideGestureName = LAEventNameSlideInFromTopRight;
+ rectToEnterToSendSlideGesture = (CGRect){ { 0.0f, kSlideGestureWindowHeight + 50.0f }, { screenSize.width, screenSize.height - (kSlideGestureWindowHeight + 50.0f) }};
+ return YES;
+ }
if (location.x < kSlideGestureWindowHeight) {
startedSlideGestureName = LAEventNameSlideInFromLeft;
rectToEnterToSendSlideGesture = (CGRect){ { kSlideGestureWindowHeight + 50.0f, 0.0f }, { screenSize.width - (kSlideGestureWindowHeight + 50.0f), screenSize.height }};
View
@@ -81,7 +81,7 @@ static void StatusBarTapCallback(CFRunLoopTimerRef timer, void *info)
LASendEventWithName(LAEventNameStatusBarSwipeLeft);
}
} else {
- if (deltaY > kStatusBarVerticalSwipeThreshold) {
+ if (deltaY > kStatusBarVerticalSwipeThreshold && (kCFCoreFoundationVersionNumber < 675.00)) {
hasSentStatusBarEvent = YES;
LASendEventWithName(LAEventNameStatusBarSwipeDown);
}
View
@@ -1,7 +1,7 @@
Package: libactivator
Depends: mobilesubstrate (>= 0.9.3228), preferenceloader (>= 2.0.2.99), firmware (>= 3.0)
Name: Activator
-Version: 1.5.8
+Version: 1.5.9~beta1
Priority: optional
Architecture: iphoneos-arm
Description: Centralized gestures, button and shortcut management for iOS
@@ -0,0 +1,6 @@
+{
+ title = "From Screen Top-Left";
+ group = "Slide In Gesture";
+ description = "Drag onto screen from top-left";
+ CoreFoundationVersion = (675.00);
+}
@@ -0,0 +1,6 @@
+{
+ title = "From Screen Top-Right";
+ group = "Slide In Gesture";
+ description = "Drag onto screen from top-right";
+ CoreFoundationVersion = (675.00);
+}
@@ -1,5 +1,5 @@
{
- title = "Swipe Down";
- group = "Status Bar";
- description = "Tap and drag down from statusbar";
+ title = "From Screen Top";
+ group = "Slide In Gesture";
+ description = "Drag onto screen from statusbar";
}
View
@@ -222,7 +222,6 @@ extern NSString * const LAEventNameSpringBoardSpread;
extern NSString * const LAEventNameStatusBarSwipeRight;
extern NSString * const LAEventNameStatusBarSwipeLeft;
-extern NSString * const LAEventNameStatusBarSwipeDown;
extern NSString * const LAEventNameStatusBarTapDouble;
extern NSString * const LAEventNameStatusBarTapSingle;
extern NSString * const LAEventNameStatusBarHold;
@@ -242,6 +241,10 @@ extern NSString * const LAEventNameSlideInFromBottomLeft;
extern NSString * const LAEventNameSlideInFromBottomRight;
extern NSString * const LAEventNameSlideInFromLeft;
extern NSString * const LAEventNameSlideInFromRight;
+extern NSString * const LAEventNameStatusBarSwipeDown; // Now a slide gesture in iOS5.0+; extern and name kept for backwards compatibility
+#define LAEventNameSlideInFromTop LAEventNameStatusBarSwipeDown
+extern NSString * const LAEventNameSlideInFromTopLeft;
+extern NSString * const LAEventNameSlideInFromTopRight;
extern NSString * const LAEventNameMotionShake;
View
@@ -26,7 +26,6 @@ NSString * const LAEventNameSpringBoardSpread = @"libactivator.springboard.
NSString * const LAEventNameStatusBarSwipeRight = @"libactivator.statusbar.swipe.right";
NSString * const LAEventNameStatusBarSwipeLeft = @"libactivator.statusbar.swipe.left";
-NSString * const LAEventNameStatusBarSwipeDown = @"libactivator.statusbar.swipe.down";
NSString * const LAEventNameStatusBarTapDouble = @"libactivator.statusbar.tap.double";
NSString * const LAEventNameStatusBarTapSingle = @"libactivator.statusbar.tap.single";
NSString * const LAEventNameStatusBarHold = @"libactivator.statusbar.hold";
@@ -46,6 +45,9 @@ NSString * const LAEventNameSlideInFromBottomLeft = @"libactivator.slide-in.bot
NSString * const LAEventNameSlideInFromBottomRight = @"libactivator.slide-in.bottom-right";
NSString * const LAEventNameSlideInFromLeft = @"libactivator.slide-in.left";
NSString * const LAEventNameSlideInFromRight = @"libactivator.slide-in.right";
+NSString * const LAEventNameStatusBarSwipeDown = @"libactivator.statusbar.swipe.down"; // Now a slide in gesture on iOS5.0+
+NSString * const LAEventNameSlideInFromTopLeft = @"libactivator.slide-in.top-left";
+NSString * const LAEventNameSlideInFromTopRight = @"libactivator.slide-in.top-right";
NSString * const LAEventNameMotionShake = @"libactivator.motion.shake";

0 comments on commit 0d0ce63

Please sign in to comment.