moreButton + disconnectButton in Streaming, and related codings

This commit is contained in:
TrueZhuanjia committed 2025-06-06 22:06:47 +08:00
1 parent 17ecd52755
commit 822dfc433b
5 files changed
+34 -15

No files matched your search

+1
View File
@@ -29,5 +29,6 @@
- (void)addToParentStack:(UIStackView *)parentStack; - (void)addToParentStack:(UIStackView *)parentStack;
- (void)removeSubStackView:(UIStackView *)stackView; - (void)removeSubStackView:(UIStackView *)stackView;
- (void)updateLayout; - (void)updateLayout;
- (void)updateViewForFoldState;
@end @end
@@ -354,6 +354,7 @@ typedef enum
- (SettingsMenuMode)getSettingsMenuMode; - (SettingsMenuMode)getSettingsMenuMode;
- (void)enterRemoveSettingItemMode; - (void)enterRemoveSettingItemMode;
- (void)doneRemoveSettingItem; - (void)doneRemoveSettingItem;
- (void)layoutSettingsView;
@end @end
@@ -861,8 +861,21 @@ const int FrontViewPositionNone = 0xff;
#pragma mark - Public methods and property accessors #pragma mark - Public methods and property accessors
- (void)willMoveToPosition{ - (void)willMoveToPosition{
SettingsMenuMode currentMenuMode = [self getSettingsMenuMode];
_separatorLine.hidden = _frontViewPosition == FrontViewPositionLeft; _separatorLine.hidden = _frontViewPosition == FrontViewPositionLeft;
if(_frontViewPosition != FrontViewPositionLeft) [self setupMoreButtonMenu];
if(_frontViewPosition == FrontViewPositionLeft && currentMenuMode == RemoveSettingItem){
[self doneRemoveSettingItemSelected];
}
if(_frontViewPosition != FrontViewPositionLeft){
[self setupMoreButtonMenu];
[self layoutSettingsView];
//if(currentMenuMode == AllSettings) [self allSettingSelected];
//if(currentMenuMode == FavoriteSettings) [self favoriteSettingSelected];
}
} }
@@ -1046,9 +1059,14 @@ const int FrontViewPositionNone = 0xff;
if ([self.navBarMenuDelegate respondsToSelector:@selector(doneRemoveSettingItem)]) { if ([self.navBarMenuDelegate respondsToSelector:@selector(doneRemoveSettingItem)]) {
[self.navBarMenuDelegate doneRemoveSettingItem]; [self.navBarMenuDelegate doneRemoveSettingItem];
} else NSLog(@"Delegate not set or does not respond to switchToAllSettings:"); } else NSLog(@"Delegate not set or does not respond to doneRemoveSettingItem:");
} }
- (void)layoutSettingsView{
if ([self.navBarMenuDelegate respondsToSelector:@selector(layoutSettingsView)]) {
[self.navBarMenuDelegate layoutSettingsView];
} else NSLog(@"Delegate not set or does not respond to layoutSettingsView:");
}
- (void)setupMoreButtonMenu{ - (void)setupMoreButtonMenu{
@@ -1140,7 +1158,7 @@ const int FrontViewPositionNone = 0xff;
} }
- (void)buttonsInStreaming{ - (void)buttonsInStreaming{
_navItem.rightBarButtonItems = @[_disconnectButton]; _navItem.rightBarButtonItems = @[_disconnectButton, _moreButton];
} }
- (void)buttonsNotInStreaming{ - (void)buttonsNotInStreaming{
@@ -1152,6 +1170,8 @@ const int FrontViewPositionNone = 0xff;
} }
- (void)disconnectRemoteSession{ - (void)disconnectRemoteSession{
if([self getSettingsMenuMode] == RemoveSettingItem) [self doneRemoveSettingItemSelected];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SessionDisconnectedBySettingsMenuNotification" object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:@"SessionDisconnectedBySettingsMenuNotification" object:self];
[self foldRearView]; [self foldRearView];
} }
@@ -339,18 +339,6 @@ BOOL isCustomResolution(CGSize res) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed [[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed
} }
//deprecated
- (IBAction)exitButtonTapped:(id)sender {
[self->_mainFrameViewController simulateSettingsButtonPress];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SessionDisconnectedBySettingsMenuNotification" object:self];
}
//deprecated
- (IBAction)backToStreamingButtonTapped:(id)sender {
[self simulateSettingsButtonPress];
}
/* /*
- (void)addExitButtonOnTop{ - (void)addExitButtonOnTop{
UIButton *exitButton = [UIButton buttonWithType:UIButtonTypeSystem]; UIButton *exitButton = [UIButton buttonWithType:UIButtonTypeSystem];
@@ -817,6 +805,13 @@ BOOL isCustomResolution(CGSize res) {
[self saveFavoriteSettingStackIdentifiers]; [self saveFavoriteSettingStackIdentifiers];
} }
- (void)layoutSettingsView{
[self.view layoutSubviews];
if(currentSettingsMenuMode == AllSettings){
for(MenuSectionView* section in parentStack.arrangedSubviews) [section updateViewForFoldState];
}
}
- (void)switchToFavoriteSettings{ - (void)switchToFavoriteSettings{
[self updateTheme]; [self updateTheme];
currentSettingsMenuMode = FavoriteSettings; currentSettingsMenuMode = FavoriteSettings;
@@ -829,6 +824,7 @@ BOOL isCustomResolution(CGSize res) {
[view removeFromSuperview]; [view removeFromSuperview];
} }
parentStack.spacing = 15; parentStack.spacing = 15;
[self loadFavoriteSettingStackIdentifiers];
for(NSString* settingIdentifier in _favoriteSettingStackIdentifiers){ for(NSString* settingIdentifier in _favoriteSettingStackIdentifiers){
[parentStack addArrangedSubview:_settingStackDict[settingIdentifier]]; [parentStack addArrangedSubview:_settingStackDict[settingIdentifier]];
} }
@@ -279,6 +279,7 @@
#endif #endif
- (void)popFirstLaunchTip { - (void)popFirstLaunchTip {
return; // temp disable
// 初始化倒计时秒数 // 初始化倒计时秒数
__block NSInteger remainingSeconds = 16; __block NSInteger remainingSeconds = 16;