settingView close/expand control

This commit is contained in:
TrueZhuanjia
2025-06-06 22:44:17 +08:00
parent a591380d60
commit fcb68bc54f
5 changed files with 18 additions and 15 deletions
@@ -30,7 +30,8 @@
@property (weak, nonatomic) IBOutlet UINavigationItem *navigationItem;
-(void)simulateSettingsButtonPress;
-(void)expandSettingsView;
- (void)closeSettingViewAnimated:(BOOL)anaimated;
-(void)reloadStreamConfig;
-(bool)isIPhonePortrait;
#endif
@@ -382,13 +382,12 @@ static NSMutableSet* hostList;
if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) {
[self switchToAppView];
}
}
- (void)launchButtonTappedForHost:(TemporaryHost *)host {
_selectedHost = host;
if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) {
[[self revealViewController] revealToggleAnimated:NO];
[self closeSettingViewAnimated:NO];
[self switchToAppView];
[self updateAppsForHost:_selectedHost];
[self prepareToStreamApp:_sortedAppList.firstObject];
@@ -1065,13 +1064,19 @@ static NSMutableSet* hostList;
#if !TARGET_OS_TV
- (void)simulateSettingsButtonPress { //simulate pressing the setting button, called from setting view controller.
//if([self isIPhonePortrait]) return; // disable settings view expanding in iphone portrait mode since it's buggy.
if (_settingsButton.target && [_settingsButton.target respondsToSelector:_settingsButton.action]) {
[_settingsButton.target performSelector:_settingsButton.action withObject:_settingsButton];
- (void)expandSettingsView { //simulate pressing the setting button, called from setting view controller.
if (currentPosition == FrontViewPositionLeft) {
[[self revealViewController] revealToggleAnimated:YES];
}
}
- (void)closeSettingViewAnimated:(BOOL)anaimated { //simulate pressing the setting button, called from setting view controller.
if (currentPosition != FrontViewPositionLeft) {
[[self revealViewController] revealToggleAnimated:anaimated];
}
}
- (void)handleOrientationChange {
// UIDeviceOrientation targetOrientation = [[UIDevice currentDevice] orientation];
// if([self isIPhone] && UIDeviceOrientationIsPortrait(targetOrientation)) [self simulateSettingsButtonPressClose]; // on iphone, force close settings views if target orietation is portrait.
@@ -328,12 +328,6 @@ BOOL isCustomResolution(CGSize res) {
});
}
- (void)simulateSettingsButtonPress{
[self.mainFrameViewController simulateSettingsButtonPress];
}
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:NO];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed
@@ -358,7 +352,7 @@ BOOL isCustomResolution(CGSize res) {
}
- (void)edgeSwiped {
[self simulateSettingsButtonPress];
[self.mainFrameViewController closeSettingViewAnimated:YES];
}
- (BOOL)isIPhone {
@@ -729,10 +729,11 @@
- (void)expandSettingsView{
self.mainFrameViewcontroller.settingsExpandedInStreamView = true; //notify mainFrameViewContorller that this is a setting expansion in stream view, some settings shall be disabled.
[self.mainFrameViewcontroller simulateSettingsButtonPress];
[self.mainFrameViewcontroller expandSettingsView];
}
- (void)edgeSwiped{
return; // disable this now.
if([self->_mainFrameViewcontroller isIPhonePortrait]){ // disable backmenu for iphone portrait mode;
[self returnToMainFrame]; //directly quit the session
return;
+2
View File
@@ -1112,6 +1112,7 @@
INFOPLIST_FILE = "Limelight/Limelight-Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = MoonlightZWM;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -1170,6 +1171,7 @@
INFOPLIST_FILE = "Limelight/Limelight-Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = MoonlightZWM;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",