hide some settings in streaming
This commit is contained in:
committed by
TrueZhuanjia
parent
561080568c
commit
2679ba75af
@@ -32,6 +32,8 @@
|
||||
#import "LocalizationHelper.h"
|
||||
#import "CustomEdgeSlideGestureRecognizer.h"
|
||||
#import "DataManager.h"
|
||||
#import "HostCardView.h"
|
||||
#import "UIColor+Theme.h"
|
||||
#import "Moonlight-Swift.h" // not used yet.
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
@@ -314,7 +316,7 @@ static NSMutableSet* hostList;
|
||||
[self updateTitle];
|
||||
[self disableUpButton];
|
||||
[self.collectionView removeFromSuperview]; // necessary for new scroll host view reloading mechanism
|
||||
[self.view setBackgroundColor:[UIColor darkGrayColor]];
|
||||
|
||||
[self reloadScrollHostView]; // host view must be reloaded here
|
||||
}
|
||||
|
||||
@@ -972,16 +974,27 @@ static NSMutableSet* hostList;
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
[settingsViewController.resolutionSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.resolutionStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.framerateSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.fpsStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController widget:settingsViewController.bitrateSlider setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.bitrateStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.optimizeSettingsSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.optimizeSettingsStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.audioOnPCSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.audioOnPcStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.codecSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.codecStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.yuv444Selector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.yuv444Stack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.hdrSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.HdrStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.framePacingSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.framepacingStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.btMouseSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.citrixX1MouseStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.externalDisplayModeSelector setEnabled:!self.settingsExpandedInStreamView];
|
||||
settingsViewController.externalDisplayModeStack.hidden = self.settingsExpandedInStreamView;
|
||||
[settingsViewController.backToStreamingButton setEnabled:self.settingsExpandedInStreamView]; // will be deprecated soon
|
||||
// [settingsViewController.unlockDisplayOrientationSelector setEnabled:!self.settingsExpandedInStreamView && [self isFullScreenRequired]];//need "requires fullscreen" enabled in the app bunddle to make runtime orientation limitation woring
|
||||
}
|
||||
@@ -1116,10 +1129,10 @@ static NSMutableSet* hostList;
|
||||
// return isPortrait;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
- (void)viewDidLoad{
|
||||
[super viewDidLoad];
|
||||
//[OrientationHelper updateOrientationToLandscape];
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
self.settingsExpandedInStreamView = false; // init this flag
|
||||
self.revealViewController.isStreaming = false; //init this flag for rvlVC
|
||||
@@ -1216,6 +1229,10 @@ static NSMutableSet* hostList;
|
||||
[self.view addSubview:hostScrollView];
|
||||
|
||||
if ([hostList count] == 1) [self hostClicked:[hostList anyObject] view:nil]; // auto click for single host
|
||||
|
||||
|
||||
|
||||
|
||||
//if([SettingsViewController isLandscapeNow] != _streamConfig.width > _streamConfig.height)
|
||||
//[self simulateSettingsButtonPress]; //force expand setting view if orientation changed since last quit from app.
|
||||
//[self simulateSettingsButtonPress]; //force expand setting view if orientation changed since last quit from app.
|
||||
@@ -1225,8 +1242,7 @@ static NSMutableSet* hostList;
|
||||
// [settingsViewController updateResolutionTable];
|
||||
}
|
||||
|
||||
-(void)handleRealOrientationChange{
|
||||
|
||||
-(void)viewDidLayoutSubviews{
|
||||
}
|
||||
|
||||
-(void)reloadScrollHostView{
|
||||
@@ -1418,6 +1434,7 @@ static NSMutableSet* hostList;
|
||||
- (void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
[super viewDidAppear:NO];
|
||||
[self reloadScrollHostView];
|
||||
[self attachWaterMark];
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
@@ -1462,6 +1479,13 @@ static NSMutableSet* hostList;
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
/* this makes background color works*/
|
||||
for (UIView *subview in self.view.subviews) {
|
||||
[subview removeFromSuperview]; // 暂时移除所有子视图
|
||||
}
|
||||
|
||||
self.view.backgroundColor = [UIColor appBackgroundColorDark]; //theme test
|
||||
|
||||
// We can get here on home press while streaming
|
||||
// since the stream view segues to us just before
|
||||
@@ -1568,7 +1592,25 @@ static NSMutableSet* hostList;
|
||||
// Sort the host list in alphabetical order
|
||||
NSArray* sortedHostList = [[hostList allObjects] sortedArrayUsingSelector:@selector(compareName:)];
|
||||
for (TemporaryHost* comp in sortedHostList) {
|
||||
compView = [[UIComputerView alloc] initWithComputer:comp andCallback:self];
|
||||
compView = [[UIComputerView alloc] initWithComputer:comp andCallback:self]; // host view created here
|
||||
|
||||
// new host card test
|
||||
// if([comp.name isEqualToString: @"ASRockPC"]) {
|
||||
if([comp.name isEqualToString: @"PianoServer"]) {
|
||||
//if([comp.name isEqualToString: @"TrueZj"]) {
|
||||
HostCardView *testCard = [[HostCardView alloc] initWithHost:comp];
|
||||
|
||||
[self.view addSubview:testCard];
|
||||
// [testCard resizeBySizeFactor:3];
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[testCard.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor constant:0],
|
||||
[testCard.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor constant:150],
|
||||
]];
|
||||
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
compView.center = CGPointMake([self getCompViewX:compView addComp:addComp prevEdge:prevEdge], hostScrollView.frame.size.height / 2);
|
||||
prevEdge = compView.frame.origin.x + compView.frame.size.width;
|
||||
[hostScrollView addSubview:compView];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#import "SettingsViewController.h"
|
||||
#import "TemporarySettings.h"
|
||||
#import "DataManager.h"
|
||||
#import "MenuSectionView.h"
|
||||
|
||||
#import <UIKit/UIGestureRecognizerSubclass.h>
|
||||
#import <VideoToolbox/VideoToolbox.h>
|
||||
@@ -340,6 +341,51 @@ BOOL isCustomResolution(CGSize res) {
|
||||
return [self isIPhone] ? UINavigationBarHeightIPhone : UINavigationBarHeightIPad;
|
||||
}
|
||||
|
||||
|
||||
- (void)initParentStack{
|
||||
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
|
||||
// 可选:确保 scrollView 开启垂直滚动
|
||||
self.scrollView.alwaysBounceVertical = YES;
|
||||
parentStack = [[UIStackView alloc] init];
|
||||
parentStack.axis = UILayoutConstraintAxisVertical;
|
||||
parentStack.spacing = 0;
|
||||
parentStack.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self.scrollView addSubview:parentStack];
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[parentStack.topAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.topAnchor constant: [self getStandardNavBarHeight] + 13],
|
||||
[parentStack.bottomAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.bottomAnchor constant:-20],
|
||||
[parentStack.leadingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.leadingAnchor constant: 14],
|
||||
[parentStack.trailingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.trailingAnchor constant: -15],
|
||||
[parentStack.widthAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.widthAnchor]
|
||||
]];
|
||||
}
|
||||
|
||||
- (void)layoutSections{
|
||||
MenuSectionView *videoSection = [[MenuSectionView alloc] init];
|
||||
videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
[videoSection setSectionIcon:[UIImage systemImageNamed:@"airplayvideo"]];
|
||||
} else [videoSection setSectionIcon:nil];
|
||||
[videoSection addSubStackView:_resolutionStack];
|
||||
[videoSection addSubStackView:_fpsStack];
|
||||
[videoSection addSubStackView:_codecStack];
|
||||
[videoSection addToParentStack:parentStack];
|
||||
[videoSection setExpanded:YES];
|
||||
|
||||
MenuSectionView *gesturesSection = [[MenuSectionView alloc] init];
|
||||
gesturesSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Gestures"];
|
||||
if (@available(iOS 13.0, *)) {
|
||||
[gesturesSection setSectionIcon:[UIImage systemImageNamed:@"hand.draw"]];
|
||||
} else [gesturesSection setSectionIcon:nil];
|
||||
[gesturesSection addSubStackView:_keyboardToggleFingerNumStack];
|
||||
[gesturesSection addSubStackView:_slideToSettingsScreenEdgeStack];
|
||||
[gesturesSection addSubStackView:_slideToCmdToolScreenEdgeStack];
|
||||
[gesturesSection addSubStackView:_slideToSettingsDistanceStack];
|
||||
[gesturesSection addToParentStack:parentStack];
|
||||
[gesturesSection setExpanded:YES];
|
||||
}
|
||||
|
||||
|
||||
- (void)layoutWidgetes {
|
||||
|
||||
// [self.view addSubview:self.navigationBar];
|
||||
@@ -349,60 +395,65 @@ BOOL isCustomResolution(CGSize res) {
|
||||
// 可选:确保 scrollView 开启垂直滚动
|
||||
self.scrollView.alwaysBounceVertical = YES;
|
||||
|
||||
parentStack = [[UIStackView alloc] init];
|
||||
parentStack.axis = UILayoutConstraintAxisVertical;
|
||||
parentStack.spacing = 13;
|
||||
parentStack.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self.scrollView addSubview:parentStack];
|
||||
UIStackView* parentStackTmp = [[UIStackView alloc] init];
|
||||
parentStackTmp.axis = UILayoutConstraintAxisVertical;
|
||||
parentStackTmp.spacing = 13;
|
||||
parentStackTmp.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self.scrollView addSubview:parentStackTmp];
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[parentStack.topAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.topAnchor constant: [self getStandardNavBarHeight] + 20],
|
||||
[parentStack.bottomAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.bottomAnchor constant:-20],
|
||||
[parentStack.leadingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.leadingAnchor constant: 14],
|
||||
[parentStack.trailingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.trailingAnchor constant: -15],
|
||||
[parentStack.widthAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.widthAnchor]
|
||||
[parentStackTmp.topAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.topAnchor constant: [self getStandardNavBarHeight] + 300],
|
||||
[parentStackTmp.bottomAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.bottomAnchor constant:-20],
|
||||
[parentStackTmp.leadingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.leadingAnchor constant: 14],
|
||||
[parentStackTmp.trailingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.trailingAnchor constant: -15],
|
||||
[parentStackTmp.widthAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.widthAnchor]
|
||||
]];
|
||||
|
||||
[parentStack addArrangedSubview:self.resolutionStack];
|
||||
|
||||
[parentStackTmp addArrangedSubview:self.resolutionStack];
|
||||
// self.resolutionStack.hidden = YES;
|
||||
[parentStack addArrangedSubview:self.fpsStack];
|
||||
[parentStackTmp addArrangedSubview:self.fpsStack];
|
||||
// self.fpsStack.hidden = YES;
|
||||
[parentStack addArrangedSubview:self.bitrateStack];
|
||||
[parentStackTmp addArrangedSubview:self.bitrateStack];
|
||||
// self.bitrateStack.hidden = YES;
|
||||
[parentStack addArrangedSubview:self.touchModeStack];
|
||||
[parentStack addArrangedSubview:self.asyncTouchStack];
|
||||
[parentStack addArrangedSubview:self.pointerVelocityDividerStack];
|
||||
[parentStack addArrangedSubview:self.pointerVelocityFactorStack];
|
||||
[parentStack addArrangedSubview:self.touchMoveEventIntervalStack];
|
||||
[parentStack addArrangedSubview:self.mousePointerVelocityStack];
|
||||
[parentStack addArrangedSubview:self.onScreenWidgetStack];
|
||||
[parentStack addArrangedSubview:self.keyboardToggleFingerNumStack];
|
||||
[parentStack addArrangedSubview:self.liftStreamViewForKeyboardStack];
|
||||
[parentStack addArrangedSubview:self.showKeyboardToolbarStack];
|
||||
[parentStack addArrangedSubview:self.slideToSettingsScreenEdgeStack];
|
||||
[parentStack addArrangedSubview:self.slideToCmdToolScreenEdgeStack];
|
||||
[parentStack addArrangedSubview:self.slideToSettingsDistanceStack];
|
||||
[parentStack addArrangedSubview:self.optimizeSettingsStack];
|
||||
[parentStack addArrangedSubview:self.multiControllerStack];
|
||||
[parentStack addArrangedSubview:self.swapAbaxyStack];
|
||||
[parentStack addArrangedSubview:self.audioOnPcStack];
|
||||
[parentStack addArrangedSubview:self.codecStack];
|
||||
[parentStack addArrangedSubview:self.yuv444Stack];
|
||||
[parentStack addArrangedSubview:self.HdrStack];
|
||||
[parentStack addArrangedSubview:self.framepacingStack];
|
||||
[parentStack addArrangedSubview:self.reverseMouseWheelDirectionStack];
|
||||
[parentStack addArrangedSubview:self.citrixX1MouseStack];
|
||||
[parentStack addArrangedSubview:self.statsOverlayStack];
|
||||
[parentStack addArrangedSubview:self.unlockDisplayOrientationStack];
|
||||
[parentStack addArrangedSubview:self.externalDisplayModeStack];
|
||||
[parentStack addArrangedSubview:self.localMousePointerModeStack];
|
||||
[parentStackTmp addArrangedSubview:self.touchModeStack];
|
||||
[parentStackTmp addArrangedSubview:self.asyncTouchStack];
|
||||
[parentStackTmp addArrangedSubview:self.pointerVelocityDividerStack];
|
||||
[parentStackTmp addArrangedSubview:self.pointerVelocityFactorStack];
|
||||
[parentStackTmp addArrangedSubview:self.touchMoveEventIntervalStack];
|
||||
[parentStackTmp addArrangedSubview:self.mousePointerVelocityStack];
|
||||
[parentStackTmp addArrangedSubview:self.onScreenWidgetStack];
|
||||
[parentStackTmp addArrangedSubview:self.keyboardToggleFingerNumStack];
|
||||
[parentStackTmp addArrangedSubview:self.liftStreamViewForKeyboardStack];
|
||||
[parentStackTmp addArrangedSubview:self.showKeyboardToolbarStack];
|
||||
[parentStackTmp addArrangedSubview:self.slideToSettingsScreenEdgeStack];
|
||||
[parentStackTmp addArrangedSubview:self.slideToCmdToolScreenEdgeStack];
|
||||
[parentStackTmp addArrangedSubview:self.slideToSettingsDistanceStack];
|
||||
[parentStackTmp addArrangedSubview:self.optimizeSettingsStack];
|
||||
[parentStackTmp addArrangedSubview:self.multiControllerStack];
|
||||
[parentStackTmp addArrangedSubview:self.swapAbaxyStack];
|
||||
[parentStackTmp addArrangedSubview:self.audioOnPcStack];
|
||||
[parentStackTmp addArrangedSubview:self.codecStack];
|
||||
[parentStackTmp addArrangedSubview:self.yuv444Stack];
|
||||
[parentStackTmp addArrangedSubview:self.HdrStack];
|
||||
[parentStackTmp addArrangedSubview:self.framepacingStack];
|
||||
[parentStackTmp addArrangedSubview:self.reverseMouseWheelDirectionStack];
|
||||
[parentStackTmp addArrangedSubview:self.citrixX1MouseStack];
|
||||
[parentStackTmp addArrangedSubview:self.statsOverlayStack];
|
||||
[parentStackTmp addArrangedSubview:self.unlockDisplayOrientationStack];
|
||||
[parentStackTmp addArrangedSubview:self.externalDisplayModeStack];
|
||||
[parentStackTmp addArrangedSubview:self.localMousePointerModeStack];
|
||||
[parentStackTmp removeFromSuperview];
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
//[self pushDownExistingWidgets];
|
||||
//[self addExitButtonOnTop];
|
||||
|
||||
BOOL isIPad = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
|
||||
if(isIPad) [self layoutWidgetes]; // layout for ipad tmply
|
||||
if(isIPad) [self layoutWidgetes]; // layout for ipad tmply
|
||||
|
||||
[self initParentStack];
|
||||
[self layoutSections];
|
||||
|
||||
|
||||
|
||||
self->slideToCloseSettingsViewRecognizer = [[CustomEdgeSlideGestureRecognizer alloc] initWithTarget:self action:@selector(edgeSwiped)];
|
||||
slideToCloseSettingsViewRecognizer.edges = UIRectEdgeLeft;
|
||||
|
||||
Reference in New Issue
Block a user