From 58334772e254756eb35f412be39214479f04f488 Mon Sep 17 00:00:00 2001 From: Vyacheslav Iutin Date: Thu, 22 Dec 2011 12:40:32 +0700 Subject: [PATCH] fix activity indicator to detect the current orientation immediatelly after launch --- Classes/ShareKit/UI/SHKActivityIndicator.m | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Classes/ShareKit/UI/SHKActivityIndicator.m b/Classes/ShareKit/UI/SHKActivityIndicator.m index 3354f238..3cf8ff87 100644 --- a/Classes/ShareKit/UI/SHKActivityIndicator.m +++ b/Classes/ShareKit/UI/SHKActivityIndicator.m @@ -250,9 +250,8 @@ - (void)setProperRotation [self setProperRotation:YES]; } -- (void)setProperRotation:(BOOL)animated -{ - UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; +- (void)setProperRotation:(BOOL)animated { + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (animated) { @@ -260,17 +259,17 @@ - (void)setProperRotation:(BOOL)animated [UIView setAnimationDuration:0.3]; } - if (orientation == UIDeviceOrientationPortraitUpsideDown) + if (orientation == UIInterfaceOrientationPortraitUpsideDown) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(180)); - - else if (orientation == UIDeviceOrientationPortrait) + + else if (orientation == UIInterfaceOrientationPortrait) self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(0)); - else if (orientation == UIDeviceOrientationLandscapeLeft) - self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(90)); + else if (orientation == UIInterfaceOrientationLandscapeLeft) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(-90)); - else if (orientation == UIDeviceOrientationLandscapeRight) - self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(-90)); + else if (orientation == UIInterfaceOrientationLandscapeRight) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(90)); if (animated) [UIView commitAnimations];