disallow orientation change in mainframe host view (need iOS16+)
This commit is contained in:
1 parent
2bcdd25cc2
commit
033265d58e
3 files changed
+9
-1
No files matched your search
@@ -126,12 +126,16 @@ static NSMutableSet* hostList;
|
|||||||
- (void)disableUpButton {
|
- (void)disableUpButton {
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
[self->_upButton setTitle:nil];
|
[self->_upButton setTitle:nil];
|
||||||
|
self.revealViewController.mainFrameIsInHostView = true; // to allow orientation change only in app view, tell top view controller the mainframe is not in host view
|
||||||
|
[self setNeedsUpdateAllowedOrientation];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)enableUpButton {
|
- (void)enableUpButton {
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
[self->_upButton setTitle: [LocalizationHelper localizedStringForKey: @"Select New Host"]];
|
[self->_upButton setTitle: [LocalizationHelper localizedStringForKey: @"Select New Host"]];
|
||||||
|
self.revealViewController.mainFrameIsInHostView = false; // to allow orientation change only in app view, tell top view controller the mainframe is not in host view
|
||||||
|
[self setNeedsUpdateAllowedOrientation];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,6 +348,8 @@ static NSMutableSet* hostList;
|
|||||||
Log(LOG_D, @"Clicked host: %@", host.name);
|
Log(LOG_D, @"Clicked host: %@", host.name);
|
||||||
_selectedHost = host;
|
_selectedHost = host;
|
||||||
[self updateTitle];
|
[self updateTitle];
|
||||||
|
//_appManager = [[AppAssetManager alloc] initWithCallback:self];
|
||||||
|
[self.collectionView setCollectionViewLayout:self.collectionViewLayout];
|
||||||
[self.collectionView reloadData]; //for new scroll host view reloading mechanism
|
[self.collectionView reloadData]; //for new scroll host view reloading mechanism
|
||||||
[self.view addSubview:self.collectionView]; //for new scroll host view reloading mechanism
|
[self.view addSubview:self.collectionView]; //for new scroll host view reloading mechanism
|
||||||
[self attachWaterMark];
|
[self attachWaterMark];
|
||||||
@@ -1043,6 +1049,7 @@ static NSMutableSet* hostList;
|
|||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
self.settingsExpandedInStreamView = false; // init this flag
|
self.settingsExpandedInStreamView = false; // init this flag
|
||||||
self.revealViewController.isStreaming = false; //init this flag for rvlVC
|
self.revealViewController.isStreaming = false; //init this flag for rvlVC
|
||||||
|
self.revealViewController.mainFrameIsInHostView = true;
|
||||||
|
|
||||||
// Set the side bar button action. When it's tapped, it'll show the sidebar.
|
// Set the side bar button action. When it's tapped, it'll show the sidebar.
|
||||||
[_settingsButton setTarget:self.revealViewController];
|
[_settingsButton setTarget:self.revealViewController];
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ typedef NS_ENUM(NSInteger, SWRevealToggleAnimationType)
|
|||||||
@property (nonatomic,weak) id<SWRevealViewControllerDelegate> delegate;
|
@property (nonatomic,weak) id<SWRevealViewControllerDelegate> delegate;
|
||||||
|
|
||||||
@property (nonatomic,assign) bool isStreaming;
|
@property (nonatomic,assign) bool isStreaming;
|
||||||
|
@property (nonatomic,assign) bool mainFrameIsInHostView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ const int FrontViewPositionNone = 0xff;
|
|||||||
Settings *currentSettings = [dataMan retrieveSettings];
|
Settings *currentSettings = [dataMan retrieveSettings];
|
||||||
//Handle allow portrait on & off
|
//Handle allow portrait on & off
|
||||||
if(currentSettings.allowPortrait){
|
if(currentSettings.allowPortrait){
|
||||||
if (self.isStreaming) return [self getCurrentOrientation];
|
if (self.isStreaming || self.mainFrameIsInHostView) return [self getCurrentOrientation]; //orientation change is not allowed in streaming or mainframe host view
|
||||||
else return UIInterfaceOrientationMaskAll;
|
else return UIInterfaceOrientationMaskAll;
|
||||||
}
|
}
|
||||||
else return UIInterfaceOrientationMaskLandscape;
|
else return UIInterfaceOrientationMaskLandscape;
|
||||||
|
|||||||
Reference in new issue
Block a user