mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
iOS: fixed #774 (story page position after activating)
Now re-activates without story page glitches, and handles rotation while inactive properly.
This commit is contained in:
parent
5e4f7d27c5
commit
839a1d0417
1 changed files with 17 additions and 1 deletions
|
@ -57,6 +57,7 @@
|
|||
@property (readwrite) BOOL feedDetailIsVisible;
|
||||
@property (readwrite) BOOL keyboardIsShown;
|
||||
@property (readwrite) UIDeviceOrientation rotatingToOrientation;
|
||||
@property (nonatomic) UIBackgroundTaskIdentifier reorientBackgroundTask;
|
||||
|
||||
@property (nonatomic, strong) UIPopoverController *popoverController;
|
||||
|
||||
|
@ -222,11 +223,26 @@
|
|||
[self layoutFeedDetailScreen];
|
||||
}
|
||||
if (self.feedDetailIsVisible) {
|
||||
[self.storyPageControl reorientPages];
|
||||
// Defer this in the background, to avoid misaligning the detail views
|
||||
if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
|
||||
self.reorientBackgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
|
||||
[[UIApplication sharedApplication] endBackgroundTask:self.reorientBackgroundTask];
|
||||
self.reorientBackgroundTask = UIBackgroundTaskInvalid;
|
||||
}];
|
||||
[self performSelector:@selector(delayedReorientPages) withObject:nil afterDelay:0.5];
|
||||
} else {
|
||||
[self.storyPageControl reorientPages];
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)delayedReorientPages {
|
||||
[self.storyPageControl reorientPages];
|
||||
[[UIApplication sharedApplication] endBackgroundTask:self.reorientBackgroundTask];
|
||||
self.reorientBackgroundTask = UIBackgroundTaskInvalid;
|
||||
}
|
||||
|
||||
- (NSInteger)masterWidth {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
if (UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue