Commit 23dba31c authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

forward-port state restoration fixes from the 2.6 branch

parent f641f130
...@@ -382,6 +382,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType ...@@ -382,6 +382,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
{ {
_passcodeValidated = YES; _passcodeValidated = YES;
[self.playlistViewController updateViewContents]; [self.playlistViewController updateViewContents];
if ([VLCPlaybackController sharedInstance].isPlaying)
[_playerDisplayController pushPlaybackView];
} }
- (BOOL)passcodeValidated - (BOOL)passcodeValidated
...@@ -394,6 +396,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType ...@@ -394,6 +396,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
VLCKeychainCoordinator *keychainCoordinator = [VLCKeychainCoordinator defaultCoordinator]; VLCKeychainCoordinator *keychainCoordinator = [VLCKeychainCoordinator defaultCoordinator];
if (!_passcodeValidated && [keychainCoordinator passcodeLockEnabled]) { if (!_passcodeValidated && [keychainCoordinator passcodeLockEnabled]) {
[_playerDisplayController dismissPlaybackView];
[keychainCoordinator validatePasscode]; [keychainCoordinator validatePasscode];
} else } else
_passcodeValidated = YES; _passcodeValidated = YES;
......
...@@ -111,10 +111,15 @@ ...@@ -111,10 +111,15 @@
[_artworkView addGestureRecognizer:_artworkTapRecognizer]; [_artworkView addGestureRecognizer:_artworkTapRecognizer];
_artworkView.userInteractionEnabled = YES; _artworkView.userInteractionEnabled = YES;
[[NSNotificationCenter defaultCenter] addObserver:self NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
selector:@selector(appBecameActive:) [center addObserver:self
name:UIApplicationDidBecomeActiveNotification selector:@selector(appBecameActive:)
object:nil]; name:UIApplicationDidBecomeActiveNotification
object:nil];
[center addObserver:self
selector:@selector(appBecameActive:)
name:VLCPasscodeValidated
object:nil];
return self; return self;
} }
......
...@@ -26,4 +26,7 @@ typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) { ...@@ -26,4 +26,7 @@ typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) {
- (void)showFullscreenPlayback; - (void)showFullscreenPlayback;
- (void)closeFullscreenPlayback; - (void)closeFullscreenPlayback;
- (void)pushPlaybackView;
- (void)dismissPlaybackView;
@end @end
...@@ -162,6 +162,19 @@ static inline void commonSetup(VLCPlayerDisplayController *self) ...@@ -162,6 +162,19 @@ static inline void commonSetup(VLCPlayerDisplayController *self)
return [[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground; return [[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground;
} }
- (void)pushPlaybackView
{
switch (self.displayMode) {
case VLCPlayerDisplayControllerDisplayModeFullscreen:
[self _presentFullscreenPlaybackViewIfNeeded];
break;
case VLCPlayerDisplayControllerDisplayModeMiniplayer:
[self _showHideMiniPlaybackView];
default:
break;
}
}
- (void)dismissPlaybackView - (void)dismissPlaybackView
{ {
switch (self.displayMode) { switch (self.displayMode) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment