settings menu resize
This commit is contained in:
@@ -68,8 +68,7 @@ typedef NS_ENUM(NSInteger, SettingsMenuMode) {
|
||||
unlockDisplayOrientation:(BOOL)unlockDisplayOrientation
|
||||
resolutionSelected:(NSInteger)resolutionSelected
|
||||
externalDisplayMode:(NSInteger)externalDisplayMode
|
||||
localMousePointerMode:(NSInteger)localMousePointerMode
|
||||
settinsMenuMode:(NSInteger)settinsMenuMode;
|
||||
localMousePointerMode:(NSInteger)localMousePointerMode;
|
||||
|
||||
- (NSArray*) getHosts;
|
||||
- (void) updateHost:(TemporaryHost*)host;
|
||||
|
||||
@@ -89,8 +89,7 @@
|
||||
unlockDisplayOrientation:(BOOL)unlockDisplayOrientation
|
||||
resolutionSelected:(NSInteger)resolutionSelected
|
||||
externalDisplayMode:(NSInteger)externalDisplayMode
|
||||
localMousePointerMode:(NSInteger)localMousePointerMode
|
||||
settinsMenuMode:(NSInteger)settinsMenuMode{
|
||||
localMousePointerMode:(NSInteger)localMousePointerMode{
|
||||
|
||||
[_managedObjectContext performBlockAndWait:^{
|
||||
Settings* settingsToSave = [self retrieveSettings];
|
||||
@@ -129,7 +128,6 @@
|
||||
settingsToSave.resolutionSelected = [NSNumber numberWithInteger:resolutionSelected];
|
||||
settingsToSave.externalDisplayMode = [NSNumber numberWithInteger:externalDisplayMode];
|
||||
settingsToSave.localMousePointerMode = [NSNumber numberWithInteger:localMousePointerMode];
|
||||
settingsToSave.settingsMenuMode = [NSNumber numberWithInteger:settinsMenuMode];
|
||||
[self saveData];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
@property (nonatomic, retain) Settings * parent;
|
||||
|
||||
@property (nonatomic, retain) NSNumber * settingsMenuMode;
|
||||
@property (nonatomic, retain) NSNumber * settingsMenuWidth;
|
||||
@property (nonatomic, retain) NSNumber * bitrate;
|
||||
@property (nonatomic, retain) NSNumber * framerate;
|
||||
@property (nonatomic, retain) NSNumber * height;
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
self.onscreenControls = [NSNumber numberWithInteger:OnScreenControlsLevelOff];
|
||||
#else
|
||||
self.settingsMenuMode = settings.settingsMenuMode;
|
||||
self.settingsMenuWidth = settings.settingsMenuWidth;
|
||||
self.bitrate = settings.bitrate;
|
||||
self.framerate = settings.framerate;
|
||||
self.height = settings.height;
|
||||
|
||||
@@ -61,7 +61,6 @@ static StreamView* streamView;
|
||||
fixedResetCoordY = streamViewHeight * 0.4;
|
||||
pointerVelocityFactor = settings.touchPointerVelocityFactor.floatValue;
|
||||
NSLog(@"stream wdith %f, stream height %f", streamViewWidth, streamViewHeight);
|
||||
NSLog(@"pointerVelocityFactor: %.2f", pointerVelocityFactor);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -145,10 +145,6 @@ static float L3_Y;
|
||||
return touchAddrsCapturedByOnScreenControls;
|
||||
}
|
||||
|
||||
+ (void) testMethod{
|
||||
NSLog(@"swift calling test");
|
||||
}
|
||||
|
||||
- (void) sendRightStickTouchPadEvent:(CGFloat) stickX : (CGFloat) stickY{
|
||||
[_controllerSupport updateRightStick:_controller x: stickX y: stickY]; // stick value populated to the controllerSupport here
|
||||
[_controllerSupport updateFinished:_controller];
|
||||
@@ -370,13 +366,13 @@ static float L3_Y;
|
||||
// _activeCustomOscButtonPositionDict will be updated every time when the osc profile is reloaded
|
||||
OSCProfile *oscProfile = [profilesManager getSelectedProfile]; //returns the currently selected OSCProfile
|
||||
[_activeCustomOscButtonPositionDict removeAllObjects]; //reset the Dict.
|
||||
NSLog(@"_activeCustomOscButtonPositionDict update: STARTOVER");
|
||||
// NSLog(@"_activeCustomOscButtonPositionDict update: STARTOVER");
|
||||
for (NSData *buttonStateEncoded in oscProfile.buttonStates) {
|
||||
OnScreenButtonState* buttonState = [profilesManager unarchiveButtonStateEncoded:buttonStateEncoded];
|
||||
buttonState.position = [self denormalizeWidgetPosition:buttonState.position];
|
||||
if(!buttonState.isHidden && [validPositionButtonNames containsObject:buttonState.name] && (buttonState.buttonType == LegacyOscButton || [profilesManager getIndexOfSelectedProfile] == 0 ) ){
|
||||
[_activeCustomOscButtonPositionDict setObject:[NSValue valueWithCGPoint:buttonState.position] forKey:buttonState.name]; // we got a buttonname -> position dict here
|
||||
NSLog(@"_activeCustomOscButtonPositionDict update, button name:%@, position: %f, %f", buttonState.name, buttonState.position.x, buttonState.position.y);
|
||||
// NSLog(@"_activeCustomOscButtonPositionDict update, button name:%@, position: %f, %f", buttonState.name, buttonState.position.x, buttonState.position.y);
|
||||
}
|
||||
|
||||
// retrieve size factors & other necessary configurations for complex control
|
||||
@@ -397,7 +393,7 @@ static float L3_Y;
|
||||
if(_dPadSizeFactor == 0) _dPadSizeFactor = 1.0; // dealing with invalid sizefactor
|
||||
}
|
||||
}
|
||||
NSLog(@"_activeCustomOscButtonPositionDict update, active button number: %lu", (unsigned long)[_activeCustomOscButtonPositionDict count]);
|
||||
//NSLog(@"_activeCustomOscButtonPositionDict update, active button number: %lu", (unsigned long)[_activeCustomOscButtonPositionDict count]);
|
||||
}
|
||||
else{
|
||||
// deal with simple & full mode configurations
|
||||
@@ -405,7 +401,7 @@ static float L3_Y;
|
||||
_leftStickOpacity = _rightStickOpacity = DEFAULT_STICK_OPACITY;
|
||||
}
|
||||
|
||||
NSLog(@"rightStickOpacity: %f", _rightStickOpacity);
|
||||
//NSLog(@"rightStickOpacity: %f", _rightStickOpacity);
|
||||
|
||||
// belows are orginal codes:
|
||||
switch (self._level) {
|
||||
@@ -849,7 +845,7 @@ static float L3_Y;
|
||||
[buttonLayer.name isEqualToString:@"rightButton"] ||
|
||||
[buttonLayer.name isEqualToString:@"downButton"] ||
|
||||
[buttonLayer.name isEqualToString:@"leftButton"]){
|
||||
NSLog(@"layerName: %@, alpha: %f", buttonLayer.name, buttonStateDecoded.backgroundAlpha);
|
||||
// NSLog(@"layerName: %@, alpha: %f", buttonLayer.name, buttonStateDecoded.backgroundAlpha);
|
||||
[self adjustControllerLayerOpacityWith:buttonLayer and:buttonStateDecoded.backgroundAlpha];
|
||||
}
|
||||
if([buttonLayer.name isEqualToString:@"leftStickBackground"]){
|
||||
|
||||
@@ -43,10 +43,6 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
||||
StreamView* streamView;
|
||||
}
|
||||
|
||||
+ (void) testMethod{
|
||||
NSLog(@"swift calling test 666");
|
||||
}
|
||||
|
||||
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings {
|
||||
self = [self init];
|
||||
self->streamView = view;
|
||||
|
||||
@@ -221,13 +221,11 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
[self becomeFirstResponder];
|
||||
}
|
||||
|
||||
// this method also deals with lifting streamview for local keyboard
|
||||
- (void)keyboardWillShow:(NSNotification *)notification{
|
||||
if(settings.liftStreamViewForKeyboard && !isInputingText){
|
||||
NSDictionary *userInfo = notification.userInfo;
|
||||
// Get the keyboard size from the notification
|
||||
CGRect keyboardFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||
// NSLog(@"keyboard height %f, lowest point height %f", keyboardFrame.size.height, keyboardToggleRecognizer.lowestTouchPointHeight);
|
||||
if(keyboardFrame.size.height < CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.25) return; // return in case of abnormal keyboard height
|
||||
HeightViewLiftedTo = keyboardFrame.size.height - keyboardToggleRecognizer.lowestTouchPointHeight + CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.1; // lift the StreamView to the height of lowest touch point of multi-finger tap gesture, while reserving the view of 1/10 screen height for remote typing.
|
||||
if(HeightViewLiftedTo < 0) HeightViewLiftedTo = 0; // set HeightViewLiftedTo to 0 if it is high enough and not going to be covered by keyboard.
|
||||
@@ -389,7 +387,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
|
||||
- (void) reloadOnScreenWidgetViews{
|
||||
|
||||
NSLog(@"reload on screen keyboard buttons here");
|
||||
// NSLog(@"reload on screen keyboard buttons here");
|
||||
|
||||
// remove all keyboard widget views first
|
||||
[self clearOnScreenKeyboardButtons];
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<attribute name="resolutionSelected" optional="YES" attributeType="Integer 16" defaultValueString="5" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="reverseMouseWheelDirection" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="settingsMenuMode" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="settingsMenuWidth" attributeType="Float" defaultValueString="390" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="showKeyboardToolbar" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="slideToSettingsDistance" optional="YES" attributeType="Float" defaultValueString="0.25" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="slideToSettingsScreenEdge" optional="YES" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
//BOOL ret = NO;
|
||||
freeaddrinfo(result);
|
||||
|
||||
NSLog(@"IP Check, is prohibited: %d", ret);
|
||||
// NSLog(@"IP Check, is prohibited: %d", ret);
|
||||
|
||||
return NO;
|
||||
//#else
|
||||
|
||||
@@ -119,8 +119,6 @@ static const CGFloat cellOffsetY = 20;
|
||||
|
||||
- (void)didMoveToParentViewController:(UIViewController *)parent {
|
||||
[super didMoveToParentViewController:parent];
|
||||
NSLog(@"moved to parentVC: %@", parent);
|
||||
// 可以在这里进行一些初始化,比如加载数据、刷新 UI 等
|
||||
}
|
||||
|
||||
- (void)addHost:(TemporaryHost *)host {
|
||||
@@ -130,9 +128,7 @@ static const CGFloat cellOffsetY = 20;
|
||||
[self.items addObject:host];
|
||||
[self.items addObject:host];
|
||||
[self.collectionView reloadData];
|
||||
// [self.view layoutIfNeeded];
|
||||
}
|
||||
NSLog(@"addhost log");
|
||||
}
|
||||
|
||||
- (void)removeHost:(TemporaryHost *)host {
|
||||
@@ -194,7 +190,6 @@ static const CGFloat cellOffsetY = 20;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSLog(@"config cell log");
|
||||
|
||||
HostCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HostCell" forIndexPath:indexPath];
|
||||
TemporaryHost *host = self.items[indexPath.item];
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
NSArray* _sortedAppList;
|
||||
NSCache* _boxArtCache;
|
||||
bool _background;
|
||||
UIView* menuSeparator;
|
||||
UIView* snapshot;
|
||||
UINavigationBarAppearance *navBarAppearanceStandard;
|
||||
UINavigationBarAppearance *navBarAppearanceScroll;
|
||||
|
||||
@@ -417,7 +419,6 @@ static NSMutableSet* hostList;
|
||||
|
||||
- (void)pairButtonTappedForHost:(TemporaryHost *)host{
|
||||
_selectedHost = host;
|
||||
NSLog(@"pairButtonTappedForHost");
|
||||
[self showLoadingFrame: ^{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
// Wait for the PC's status to be known
|
||||
@@ -665,7 +666,6 @@ static NSMutableSet* hostList;
|
||||
UIAlertController* netTestAlert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Network Test Complete"] message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
[netTestAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:nil]];
|
||||
[[self activeViewController] presentViewController:netTestAlert animated:YES completion:^{
|
||||
NSLog(@"restore tint");
|
||||
[self restoreTintColorForAllSubViews];
|
||||
}];
|
||||
}];
|
||||
@@ -1217,7 +1217,6 @@ static NSMutableSet* hostList;
|
||||
self->waterMark.font = [UIFont systemFontOfSize:22];
|
||||
self->waterMark.text = [LocalizationHelper localizedStringForKey:@"waterMarkText"];
|
||||
CGFloat labelHeight = 60;
|
||||
NSLog(@"fullscr: %d", [self isFullScreenRequired]);
|
||||
// the app is unable to automatically lock screen orientation in app window resizable mode(aka. not require fullscreen)
|
||||
|
||||
// if(![self isFullScreenRequired]){
|
||||
@@ -1533,13 +1532,14 @@ static NSMutableSet* hostList;
|
||||
// SettingsViewController* settingsViewController = (SettingsViewController*)[self.revealViewController rearViewController];
|
||||
// [settingsViewController updateResolutionTable];
|
||||
|
||||
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
|
||||
[self.view addGestureRecognizer:longPress];
|
||||
|
||||
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
|
||||
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
|
||||
// 强制加载视图
|
||||
__unused UIView *view = viewController.view;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)viewDidLayoutSubviews{
|
||||
@@ -2034,10 +2034,79 @@ static NSMutableSet* hostList;
|
||||
[_boxArtCache removeAllObjects];
|
||||
}
|
||||
|
||||
- (UIView* )findMenuSeparator{
|
||||
BOOL shouldBreak = NO;
|
||||
UIView* seperator=self.view;
|
||||
while(seperator && !shouldBreak) {
|
||||
for(UIView* view in seperator.subviews) {
|
||||
if([view.accessibilityIdentifier isEqualToString:@"menuSeparator"]) {
|
||||
seperator = view;
|
||||
shouldBreak = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldBreak) break;
|
||||
seperator = seperator.superview;
|
||||
}
|
||||
return seperator;
|
||||
}
|
||||
|
||||
- (void)handleMenuResize:(UILongPressGestureRecognizer *)gesture {
|
||||
CGPoint locationInView = [gesture locationInView:self.view];
|
||||
CGPoint locationInSuperView = [gesture locationInView:self.revealViewController.view];
|
||||
|
||||
menuSeparator = [self findMenuSeparator];
|
||||
if(menuSeparator.hidden || menuSeparator == nil) return;
|
||||
|
||||
if(gesture.state == UIGestureRecognizerStateBegan){
|
||||
if(locationInView.x < 30) {
|
||||
snapshot = [[UIView alloc] init];
|
||||
snapshot.backgroundColor = [ThemeManager appPrimaryColor];
|
||||
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.height;
|
||||
snapshot.frame = CGRectMake(locationInSuperView.x,0, 2, screenWidth);
|
||||
[self.revealViewController.view addSubview:snapshot];
|
||||
}
|
||||
return;
|
||||
}
|
||||
CGFloat screenWidthInPoints = CGRectGetWidth([[UIScreen mainScreen] bounds]);
|
||||
CGFloat limitedWidth = MIN(MAX(locationInSuperView.x, 280),screenWidthInPoints/2);
|
||||
if(gesture.state == UIGestureRecognizerStateChanged){
|
||||
if(snapshot) snapshot.center = CGPointMake(limitedWidth, snapshot.center.y);
|
||||
}
|
||||
if(gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateCancelled){
|
||||
[snapshot removeFromSuperview];
|
||||
self.revealViewController.rearViewRevealWidth = limitedWidth;
|
||||
[self.revealViewController setupNavigationBar];
|
||||
if(self.revealViewController.isStreaming) [self.revealViewController buttonsInStreaming];
|
||||
else [self.revealViewController buttonsNotInStreaming];
|
||||
DataManager* dataMan = [[DataManager alloc] init];
|
||||
Settings* settings = [dataMan retrieveSettings];
|
||||
settings.settingsMenuWidth = [NSNumber numberWithFloat:self.revealViewController.rearViewRevealWidth];
|
||||
[dataMan saveData];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
/*
|
||||
NSLog(@"%f touchesMoved", CACurrentMediaTime());
|
||||
UITouch* touch = touches.anyObject;
|
||||
CGPoint touchPoint = [touch locationInView:self.view.superview];
|
||||
if(snapshot){
|
||||
snapshot.center = CGPointMake(touchPoint.x, snapshot.center.y);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[snapshot removeFromSuperview];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
[textField resignFirstResponder];
|
||||
return YES;
|
||||
|
||||
@@ -146,6 +146,8 @@
|
||||
|
||||
#pragma mark - SWRevealViewController Class
|
||||
|
||||
|
||||
|
||||
// Enum values for setFrontViewPosition:animated:
|
||||
typedef NS_ENUM( NSInteger, FrontViewPosition)
|
||||
{
|
||||
@@ -328,7 +330,7 @@ typedef NS_ENUM(NSInteger, SWRevealToggleAnimationType)
|
||||
|
||||
- (void)buttonsInStreaming;
|
||||
- (void)buttonsNotInStreaming;
|
||||
|
||||
- (void)setupNavigationBar;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ static CGFloat scaledValue( CGFloat v1, CGFloat min2, CGFloat max2, CGFloat min1
|
||||
|
||||
_frontView = [[UIView alloc] initWithFrame:bounds];
|
||||
_frontView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
||||
_frontView.userInteractionEnabled = YES;
|
||||
|
||||
[self reloadShadow];
|
||||
|
||||
[self addSubview:_frontView];
|
||||
@@ -234,6 +236,7 @@ static CGFloat scaledValue( CGFloat v1, CGFloat min2, CGFloat max2, CGFloat min1
|
||||
|
||||
# pragma mark - overrides
|
||||
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
if ( _disableLayout ) return;
|
||||
@@ -688,7 +691,11 @@ const int FrontViewPositionNone = 0xff;
|
||||
_rearViewPosition = FrontViewPositionLeft;
|
||||
_rightViewPosition = FrontViewPositionLeft;
|
||||
// _rearViewRevealWidth = 492.0f;
|
||||
_rearViewRevealWidth = 390; //mark: settingMenuLayout
|
||||
|
||||
DataManager* dataMan = [[DataManager alloc] init];
|
||||
TemporarySettings* currentSettings = [dataMan getSettings];
|
||||
_rearViewRevealWidth = currentSettings.settingsMenuWidth.floatValue; //mark: settingMenuLayout
|
||||
|
||||
// _rearViewRevealOverdraw = 60.0f;
|
||||
_rearViewRevealOverdraw = 0.0f;
|
||||
_rearViewRevealDisplacement = 40.0f;
|
||||
@@ -783,7 +790,6 @@ const int FrontViewPositionNone = 0xff;
|
||||
// now set the desired initial position
|
||||
[self _setFrontViewPosition:initialPosition withDuration:0.0];
|
||||
[self setupMenuSeparator];
|
||||
|
||||
}
|
||||
|
||||
- (bool)isIphone{
|
||||
@@ -831,6 +837,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
|
||||
|
||||
- (void)viewDidLoad{
|
||||
|
||||
self.isStreaming = false; //init this flag
|
||||
}
|
||||
|
||||
@@ -862,6 +869,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
|
||||
- (void)willMoveToPosition{
|
||||
|
||||
|
||||
SettingsMenuMode currentMenuMode = [self getSettingsMenuMode];
|
||||
|
||||
_separatorLine.hidden = _frontViewPosition == FrontViewPositionLeft;
|
||||
@@ -876,12 +884,17 @@ const int FrontViewPositionNone = 0xff;
|
||||
//if(currentMenuMode == AllSettings) [self allSettingSelected];
|
||||
//if(currentMenuMode == FavoriteSettings) [self favoriteSettingSelected];
|
||||
}
|
||||
else{
|
||||
// _rearViewRevealWidth = _rearViewRevealWidth + 20;
|
||||
[self setupNavigationBar];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)setupMenuSeparator{
|
||||
// 分隔线
|
||||
_separatorLine = [[UIView alloc] init];
|
||||
_separatorLine.accessibilityIdentifier = @"menuSeparator";
|
||||
_separatorLine.backgroundColor = [ThemeManager separatorColor];
|
||||
_separatorLine.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[_contentView.frontView addSubview:_separatorLine];
|
||||
@@ -907,7 +920,9 @@ const int FrontViewPositionNone = 0xff;
|
||||
|
||||
- (void)setupNavigationBar {
|
||||
// 创建导航栏
|
||||
if (_dockedNavBar == nil) _dockedNavBar = [[UINavigationBar alloc] init];
|
||||
if (_dockedNavBar == nil || _rearViewRevealWidth != _dockedNavBar.bounds.size.width) _dockedNavBar = [[UINavigationBar alloc] init];
|
||||
|
||||
//_dockedNavBar = [[UINavigationBar alloc] init];
|
||||
_dockedNavBar.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
_dockedNavBar.userInteractionEnabled = YES;
|
||||
|
||||
@@ -942,6 +957,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
[_dockedNavBar setItems:@[_navItem]];
|
||||
_dockedNavBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
|
||||
|
||||
[_dockedNavBar removeFromSuperview];
|
||||
[_contentView.rearNavView addSubview:_dockedNavBar];
|
||||
|
||||
// 设置导航栏约束
|
||||
@@ -951,7 +967,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
[_dockedNavBar.leadingAnchor constraintEqualToAnchor:_contentView.rearNavView.leadingAnchor],
|
||||
[_dockedNavBar.widthAnchor constraintEqualToConstant:_rearViewRevealWidth],
|
||||
]];
|
||||
NSLog(@"rearViewRevealWidth %f", _rearViewRevealWidth);
|
||||
[self layoutSettingsView];
|
||||
|
||||
}
|
||||
|
||||
@@ -2018,7 +2034,6 @@ const int FrontViewPositionNone = 0xff;
|
||||
if ( positionIsChanging )
|
||||
{
|
||||
if ( [self->_delegate respondsToSelector:@selector(revealController:didMoveToPosition:)] ){
|
||||
NSLog(@"expansion: %f", CACurrentMediaTime() - self->timeStamp);
|
||||
[self->_delegate revealController:self didMoveToPosition:newPosition];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ BOOL isCustomResolution(CGSize res) {
|
||||
bool scrollDown = location.y > self.view.bounds.size.height - 100;
|
||||
bool scrollUp = location.y < 150;
|
||||
|
||||
NSLog(@"%f flag: %d, %d, obj: %@, locY: %f", CACurrentMediaTime(), scrollUp, scrollDown, _autoScrollDisplayLink, location.y);
|
||||
//NSLog(@"%f flag: %d, %d, obj: %@, locY: %f", CACurrentMediaTime(), scrollUp, scrollDown, _autoScrollDisplayLink, location.y);
|
||||
|
||||
if(!(scrollUp||scrollDown)) [self stopAutoScroll];
|
||||
|
||||
@@ -624,7 +624,7 @@ BOOL isCustomResolution(CGSize res) {
|
||||
if(scrollDown) scrollDirection = 1;
|
||||
if(scrollUp) scrollDirection = -1;
|
||||
_scrollSpeed = _scrollSpeed * scrollDirection;
|
||||
NSLog(@"%f, scrollSpeed: %f", CACurrentMediaTime(), _scrollSpeed);
|
||||
//NSLog(@"%f, scrollSpeed: %f", CACurrentMediaTime(), _scrollSpeed);
|
||||
|
||||
_autoScrollDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(startScroll)];
|
||||
[_autoScrollDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
||||
@@ -711,12 +711,8 @@ BOOL isCustomResolution(CGSize res) {
|
||||
UIView *subview = parentStack.arrangedSubviews[i];
|
||||
// CGRect frame = [subview convertRect:subview.bounds toView:parentStack];
|
||||
CGFloat stackMinY = CGRectGetMinY(subview.frame);
|
||||
NSLog(@" index: %ld, stackY: %f, touchY: %f", (long)i, CGRectGetMidY(subview.frame), location.y);
|
||||
if(stackMinY < location.y){
|
||||
NSLog(@"index: %ld", i);
|
||||
//subview.backgroundColor = [ThemeManager appPrimaryColorWithAlpha];
|
||||
return i;
|
||||
}
|
||||
// NSLog(@" index: %ld, stackY: %f, touchY: %f", (long)i, CGRectGetMidY(subview.frame), location.y);
|
||||
if(stackMinY < location.y) return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -779,7 +775,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self addSettingToFavorite:self->capturedStack];
|
||||
// 在这里执行收藏逻辑
|
||||
}];
|
||||
[actionSheet addAction:addFavoriteAction];
|
||||
return actionSheet;
|
||||
@@ -825,7 +820,7 @@ BOOL isCustomResolution(CGSize res) {
|
||||
|
||||
case UIGestureRecognizerStateChanged:
|
||||
snapshot.center = CGPointMake(locationInParentStack.x, locationInParentStack.y);
|
||||
NSLog(@"coordY in rootView: %f", locationInRootView.y);
|
||||
// NSLog(@"coordY in rootView: %f", locationInRootView.y);
|
||||
[self handleAutoScroll:locationInRootView];
|
||||
[self updateRelocationIndicatorFor:locationInParentStack];
|
||||
|
||||
@@ -834,7 +829,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
case UIGestureRecognizerStateCancelled:
|
||||
case UIGestureRecognizerStateEnded:
|
||||
// 更新快照视图位置
|
||||
// snapshot.center = CGPointMake(originalCenter.x, point.y);
|
||||
[self stopAutoScroll];
|
||||
[snapshot removeFromSuperview];
|
||||
snapshot = nil;
|
||||
@@ -843,7 +837,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[self clearRelocationIndicator];
|
||||
NSInteger oldIndex = [parentStack.arrangedSubviews indexOfObject:capturedStack];
|
||||
newIndex = newIndex > oldIndex ? newIndex - 1 : newIndex;
|
||||
//NSInteger newIndex = 1;
|
||||
//NSLog(@"newidx %ld, oldidx %ld", newIndex, oldIndex);
|
||||
if(settingStackWillBeRelocatedToLowestPosition){
|
||||
newIndex = newIndex + 1;
|
||||
@@ -978,8 +971,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
}
|
||||
|
||||
- (void)switchToAllSettings{
|
||||
|
||||
|
||||
for(UIView* view in parentStack.subviews){
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
@@ -1226,7 +1217,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[self.customResolutionSwitch addTarget:self action:@selector(customResolutionSwitched:) forControlEvents:UIControlEventValueChanged];
|
||||
CGSize currentResolution = CGSizeMake(currentSettings.width.intValue, currentSettings.height.intValue);
|
||||
[self.customResolutionSwitch setOn: isCustomResolution(currentResolution)];
|
||||
NSLog(@"isCustomResolution %d", isCustomResolution(currentResolution));
|
||||
|
||||
[self.framerateSelector setSelectedSegmentIndex:framerate];
|
||||
[self.framerateSelector addTarget:self action:@selector(updateBitrate) forControlEvents:UIControlEventValueChanged];
|
||||
@@ -1934,15 +1924,13 @@ BOOL isCustomResolution(CGSize res) {
|
||||
useFramePacing:useFramePacing
|
||||
enableHdr:enableHdr
|
||||
btMouseSupport:btMouseSupport
|
||||
// absoluteTouchMode:absoluteTouchMode
|
||||
touchMode:touchMode
|
||||
statsOverlayLevel:statsOverlayLevel
|
||||
statsOverlayEnabled:statsOverlayEnabled
|
||||
unlockDisplayOrientation:unlockDisplayOrientation
|
||||
resolutionSelected:resolutionSelected
|
||||
externalDisplayMode:externalDisplayMode
|
||||
localMousePointerMode:localMousePointerMode
|
||||
settinsMenuMode:currentSettingsMenuMode];
|
||||
localMousePointerMode:localMousePointerMode];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
||||
@@ -294,7 +294,6 @@
|
||||
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Got it! (15)"]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * _Nonnull action) {
|
||||
NSLog(@"用户确认了操作");
|
||||
}];
|
||||
confirmAction.enabled = NO;
|
||||
[alert addAction:confirmAction];
|
||||
@@ -371,7 +370,7 @@
|
||||
*/
|
||||
if(_settings.externalDisplayMode.intValue == 2) _streamVideoRenderView = _streamView;
|
||||
else {
|
||||
NSLog(@"renderView separated from streamView");
|
||||
//NSLog(@"renderView separated from streamView");
|
||||
_streamVideoRenderView = (StreamView*)[[UIView alloc] initWithFrame:self.view.frame];
|
||||
_streamVideoRenderView.bounds = _streamView.bounds;
|
||||
_streamVideoRenderView.userInteractionEnabled = false; // this will prevent renderView from intrecepting touchEvents which shall be interacting with streamView
|
||||
|
||||
Reference in New Issue
Block a user