mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-18 14:29:59 +00:00
Allow tvOS to back out from app grid to PC grid
This commit is contained in:
@@ -48,7 +48,9 @@
|
||||
NSArray* _sortedAppList;
|
||||
NSCache* _boxArtCache;
|
||||
bool _background;
|
||||
#if !TARGET_OS_TV
|
||||
#if TARGET_OS_TV
|
||||
UITapGestureRecognizer* _menuRecognizer;
|
||||
#else
|
||||
UIButton* _pullArrow;
|
||||
#endif
|
||||
}
|
||||
@@ -231,6 +233,12 @@ static NSMutableSet* hostList;
|
||||
}
|
||||
|
||||
- (void)showHostSelectionView {
|
||||
#if TARGET_OS_TV
|
||||
// Remove the menu button intercept to allow the app to exit
|
||||
// when at the host selection view.
|
||||
[self.view removeGestureRecognizer:_menuRecognizer];
|
||||
#endif
|
||||
|
||||
[_appManager stopRetrieving];
|
||||
_selectedHost = nil;
|
||||
_computerNameButton.title = @"No Host Selected";
|
||||
@@ -276,6 +284,11 @@ static NSMutableSet* hostList;
|
||||
_selectedHost = host;
|
||||
[self disableNavigation];
|
||||
|
||||
#if TARGET_OS_TV
|
||||
// Intercept the menu key to go back to the host page
|
||||
[self.view addGestureRecognizer:_menuRecognizer];
|
||||
#endif
|
||||
|
||||
// If we are online, paired, and have a cached app list, skip straight
|
||||
// to the app grid without a loading frame. This is the fast path that users
|
||||
// should hit most. Check for a valid view because we don't want to hit the fast
|
||||
@@ -663,6 +676,10 @@ static NSMutableSet* hostList;
|
||||
|
||||
// Get callbacks associated with the viewController
|
||||
[self.revealViewController setDelegate:self];
|
||||
#else
|
||||
_menuRecognizer = [[UITapGestureRecognizer alloc] init];
|
||||
[_menuRecognizer addTarget:self action: @selector(showHostSelectionView)];
|
||||
_menuRecognizer.allowedPressTypes = [[NSArray alloc] initWithObjects:[NSNumber numberWithLong:UIPressTypeMenu], nil];
|
||||
#endif
|
||||
|
||||
_loadingFrame = [self.storyboard instantiateViewControllerWithIdentifier:@"loadingFrame"];
|
||||
|
||||
Reference in New Issue
Block a user