moreButton + disconnectButton in Streaming, and related codings
This commit is contained in:
@@ -29,5 +29,6 @@
|
||||
- (void)addToParentStack:(UIStackView *)parentStack;
|
||||
- (void)removeSubStackView:(UIStackView *)stackView;
|
||||
- (void)updateLayout;
|
||||
- (void)updateViewForFoldState;
|
||||
|
||||
@end
|
||||
|
||||
@@ -354,6 +354,7 @@ typedef enum
|
||||
- (SettingsMenuMode)getSettingsMenuMode;
|
||||
- (void)enterRemoveSettingItemMode;
|
||||
- (void)doneRemoveSettingItem;
|
||||
- (void)layoutSettingsView;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -861,8 +861,21 @@ const int FrontViewPositionNone = 0xff;
|
||||
#pragma mark - Public methods and property accessors
|
||||
|
||||
- (void)willMoveToPosition{
|
||||
|
||||
SettingsMenuMode currentMenuMode = [self getSettingsMenuMode];
|
||||
|
||||
_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)]) {
|
||||
[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{
|
||||
@@ -1140,7 +1158,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
}
|
||||
|
||||
- (void)buttonsInStreaming{
|
||||
_navItem.rightBarButtonItems = @[_disconnectButton];
|
||||
_navItem.rightBarButtonItems = @[_disconnectButton, _moreButton];
|
||||
}
|
||||
|
||||
- (void)buttonsNotInStreaming{
|
||||
@@ -1152,6 +1170,8 @@ const int FrontViewPositionNone = 0xff;
|
||||
}
|
||||
|
||||
- (void)disconnectRemoteSession{
|
||||
if([self getSettingsMenuMode] == RemoveSettingItem) [self doneRemoveSettingItemSelected];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"SessionDisconnectedBySettingsMenuNotification" object:self];
|
||||
[self foldRearView];
|
||||
}
|
||||
|
||||
@@ -339,18 +339,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[[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{
|
||||
UIButton *exitButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
@@ -817,6 +805,13 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[self saveFavoriteSettingStackIdentifiers];
|
||||
}
|
||||
|
||||
- (void)layoutSettingsView{
|
||||
[self.view layoutSubviews];
|
||||
if(currentSettingsMenuMode == AllSettings){
|
||||
for(MenuSectionView* section in parentStack.arrangedSubviews) [section updateViewForFoldState];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)switchToFavoriteSettings{
|
||||
[self updateTheme];
|
||||
currentSettingsMenuMode = FavoriteSettings;
|
||||
@@ -829,6 +824,7 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
parentStack.spacing = 15;
|
||||
[self loadFavoriteSettingStackIdentifiers];
|
||||
for(NSString* settingIdentifier in _favoriteSettingStackIdentifiers){
|
||||
[parentStack addArrangedSubview:_settingStackDict[settingIdentifier]];
|
||||
}
|
||||
|
||||
@@ -279,6 +279,7 @@
|
||||
#endif
|
||||
|
||||
- (void)popFirstLaunchTip {
|
||||
return; // temp disable
|
||||
// 初始化倒计时秒数
|
||||
__block NSInteger remainingSeconds = 16;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user