Tips for screen orientation Change (non-FullScreen version)
This commit is contained in:
1 parent
3894d92f1b
commit
766e30a066
4 files changed
+91
-31
No files matched your search
@@ -73,6 +73,8 @@
|
|||||||
<array>
|
<array>
|
||||||
<string>armv7</string>
|
<string>armv7</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>UIRequiresFullScreen</key>
|
||||||
|
<false/>
|
||||||
<key>UIStatusBarHidden</key>
|
<key>UIStatusBarHidden</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
|||||||
@@ -588,29 +588,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Contact True砖家(the Developer)" : {
|
|
||||||
"extractionState" : "manual",
|
|
||||||
"localizations" : {
|
|
||||||
"zh-Hans" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "开发者: True砖家 (B站)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zh-Hant" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "开发者: True砖家 (B站)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zh-HK" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "开发者: True砖家 (B站)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Current profile updated successfully" : {
|
"Current profile updated successfully" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@@ -2136,6 +2113,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"screenRotationTIp" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Tips: Manually lock screen orientation to avoid display anomalies"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "提示: 手动锁定屏幕方向避免串流显示异常"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "提示: 手动锁定屏幕方向避免串流显示异常"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "提示: 手动锁定屏幕方向避免串流显示异常"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Searching for PCs on your network..." : {
|
"Searching for PCs on your network..." : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@@ -2505,7 +2511,7 @@
|
|||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "提示: 从屏幕连续滑动一定距离退出远程桌面. 滑动边缘和距离取决于菜单设置."
|
"value" : "\\n提示: 从屏幕连续滑动一定距离退出远程桌面. 滑动边缘和距离取决于菜单设置."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2844,6 +2850,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"waterMarkText" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Contact True砖家(the Developer)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "开发者: True砖家 (B站)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "开发者: True砖家 (B站)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "needs_review",
|
||||||
|
"value" : "开发者: True砖家 (B站)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Your network connection isn't performing well. Reduce your video bitrate setting or try a faster connection." : {
|
"Your network connection isn't performing well. Reduce your video bitrate setting or try a faster connection." : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -1004,16 +1004,39 @@ static NSMutableSet* hostList;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isFullScreenRequired {
|
||||||
|
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
|
||||||
|
NSNumber *requiresFullScreen = infoDictionary[@"UIRequiresFullScreen"];
|
||||||
|
|
||||||
|
if (requiresFullScreen != nil) {
|
||||||
|
return [requiresFullScreen boolValue];
|
||||||
|
}
|
||||||
|
// Default behavior if the key is not set
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)attachWaterMark {
|
- (void)attachWaterMark {
|
||||||
// Create and configure the label
|
// Create and configure the label
|
||||||
if(true){
|
if(true){
|
||||||
[self->waterMark removeFromSuperview];
|
[self->waterMark removeFromSuperview];
|
||||||
self->waterMark = [[UILabel alloc] init];
|
self->waterMark = [[UILabel alloc] init];
|
||||||
self->waterMark.translatesAutoresizingMaskIntoConstraints = NO;
|
self->waterMark.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
self->waterMark.text = [LocalizationHelper localizedStringForKey:@"Contact True砖家(the Developer)"];
|
self->waterMark.numberOfLines = 1;
|
||||||
self->waterMark.textColor = UIColor.blackColor;
|
|
||||||
self->waterMark.alpha = 0.2;
|
|
||||||
self->waterMark.font = [UIFont systemFontOfSize:22];
|
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 resiable mode(aka. not require fullscreen)
|
||||||
|
if(![self isFullScreenRequired]){
|
||||||
|
NSString* screenRotationTip = [LocalizationHelper localizedStringForKey:@"screenRotationTIp"];
|
||||||
|
self->waterMark.text = [NSString stringWithFormat:@"%@\n%@", self->waterMark.text, screenRotationTip];
|
||||||
|
self->waterMark.numberOfLines = 0; // Allow multiline text
|
||||||
|
self->waterMark.font = [UIFont systemFontOfSize:19];
|
||||||
|
labelHeight = 80;
|
||||||
|
}
|
||||||
|
self->waterMark.textColor = UIColor.blackColor;
|
||||||
|
self->waterMark.alpha = 0.35;
|
||||||
self->waterMark.textAlignment = NSTextAlignmentCenter;
|
self->waterMark.textAlignment = NSTextAlignmentCenter;
|
||||||
self->waterMark.backgroundColor = [UIColor clearColor];
|
self->waterMark.backgroundColor = [UIColor clearColor];
|
||||||
self->waterMark.userInteractionEnabled = YES; // Enable user interaction for tap gesture
|
self->waterMark.userInteractionEnabled = YES; // Enable user interaction for tap gesture
|
||||||
@@ -1024,10 +1047,10 @@ static NSMutableSet* hostList;
|
|||||||
[self.view addSubview:self->waterMark];
|
[self.view addSubview:self->waterMark];
|
||||||
// Set up constraints
|
// Set up constraints
|
||||||
[NSLayoutConstraint activateConstraints:@[
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
[self->waterMark.centerXAnchor constraintEqualToAnchor:self.view.rightAnchor constant:-185], // Aligns the horizontal center of label to the horizontal center of view
|
[self->waterMark.centerXAnchor constraintEqualToAnchor:self.view.rightAnchor constant:-210], // Aligns the horizontal center of label to the horizontal center of view
|
||||||
[self->waterMark.centerYAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-50], // Aligns the vertical center of label to the vertical center of view
|
[self->waterMark.centerYAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-(labelHeight+10)], // Aligns the vertical center of label to the vertical center of view
|
||||||
[self->waterMark.widthAnchor constraintEqualToConstant:500], // Sets the width of label to 200 points
|
[self->waterMark.widthAnchor constraintEqualToConstant:500], // Sets the width of label to 200 points
|
||||||
[self->waterMark.heightAnchor constraintEqualToConstant:60] // Sets the height of label to 50 points
|
[self->waterMark.heightAnchor constraintEqualToConstant:labelHeight] // Sets the height of label to 50 points
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -864,7 +864,7 @@
|
|||||||
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
||||||
|
|
||||||
Log(LOG_I, @"View size changed, terminating stream");
|
Log(LOG_I, @"View size changed, terminating stream");
|
||||||
[self returnToMainFrame];
|
// [self returnToMainFrame];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Reference in new issue
Block a user