Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Classes/ShareKit/UI/SHKActivityIndicator.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,27 +250,26 @@ - (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)
{
[UIView beginAnimations:nil context:NULL];
[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];
Expand Down