diff --git a/VoidLink.xcodeproj/project.pbxproj b/VoidLink.xcodeproj/project.pbxproj index 7a6fc71a..1241e7ac 100644 --- a/VoidLink.xcodeproj/project.pbxproj +++ b/VoidLink.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 187F4B282E04658A00EECC59 /* WidgetPanelStackView.m in Sources */ = {isa = PBXBuildFile; fileRef = 187F4B272E04658A00EECC59 /* WidgetPanelStackView.m */; }; 1888C1922E24C33100108730 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1888C1912E24C33100108730 /* AboutViewController.swift */; }; 1888C1932E24C41000108730 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1888C1902E24C2C800108730 /* AboutView.swift */; }; + 188973D32E386A670025E48C /* widgetTemplatesIPhone.bin in Resources */ = {isa = PBXBuildFile; fileRef = 188973D22E386A670025E48C /* widgetTemplatesIPhone.bin */; }; 189AD29A2DE7446000E24B88 /* HostCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 189AD2992DE7446000E24B88 /* HostCollectionViewController.m */; }; 840751B32BF49C050096B657 /* CustomTapGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 840751B22BF49C050096B657 /* CustomTapGestureRecognizer.m */; }; 841BAC922DE35D6B00DA639E /* ThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 841BAC912DE35D6B00DA639E /* ThemeManager.m */; }; @@ -158,6 +159,7 @@ 187F4B272E04658A00EECC59 /* WidgetPanelStackView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WidgetPanelStackView.m; sourceTree = ""; }; 1888C1902E24C2C800108730 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = ""; }; 1888C1912E24C33100108730 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + 188973D22E386A670025E48C /* widgetTemplatesIPhone.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; name = widgetTemplatesIPhone.bin; path = PresetConfigs/widgetTemplatesIPhone.bin; sourceTree = ""; }; 189AD2962DE743B700E24B88 /* HostCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HostCollectionViewController.h; sourceTree = ""; }; 189AD2992DE7446000E24B88 /* HostCollectionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HostCollectionViewController.m; sourceTree = ""; }; 18BF141D2E0D7A00009DEE4F /* VoidLink v1.0.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "VoidLink v1.0.xcdatamodel"; sourceTree = ""; }; @@ -445,6 +447,7 @@ 843667ED2D9D70A3004A7D7F /* PresetConfigs */ = { isa = PBXGroup; children = ( + 188973D22E386A670025E48C /* widgetTemplatesIPhone.bin */, 843667EF2D9D7173004A7D7F /* widgetTemplates.bin */, ); name = PresetConfigs; @@ -959,6 +962,7 @@ files = ( FB290CFE19B2C406004C83CF /* InfoPlist.strings in Resources */, FB290D0919B2C406004C83CF /* Images.xcassets in Resources */, + 188973D32E386A670025E48C /* widgetTemplatesIPhone.bin in Resources */, FB89463819F6473800339C8A /* Launch Screen.xib in Resources */, 8454AC662C31907F00F0A302 /* iPad.storyboard in Resources */, 8454AC6A2C319BDA00F0A302 /* iPhone.storyboard in Resources */, diff --git a/VoidLink/Input/CustomOSC/OSCProfilesManager.m b/VoidLink/Input/CustomOSC/OSCProfilesManager.m index ab8fd1fa..9a18105f 100644 --- a/VoidLink/Input/CustomOSC/OSCProfilesManager.m +++ b/VoidLink/Input/CustomOSC/OSCProfilesManager.m @@ -159,8 +159,14 @@ static CGRect layoutViewBounds; [[NSUserDefaults standardUserDefaults] synchronize]; } + +- (BOOL)isIPhone{ + return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone); +} + + - (void) importDefaultTemplates{ - NSString *filePath = [[NSBundle mainBundle] pathForResource:@"widgetTemplates" ofType:@"bin"]; + NSString *filePath = [[NSBundle mainBundle] pathForResource: [self isIPhone] ? @"widgetTemplatesIPhone": @"widgetTemplates" ofType:@"bin"]; if (filePath) { // 2. 读取二进制数据 NSError *error; diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index 0183d2e4..7c90308f 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -1008,6 +1008,29 @@ } } }, + "Connecting..." : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "正在连接…" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "正在連線..." + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "正在連線..." + } + } + } + }, "Connection Error" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin new file mode 100644 index 00000000..5bb43477 Binary files /dev/null and b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin differ diff --git a/VoidLink/Utility/Utils.m b/VoidLink/Utility/Utils.m index df974838..8f50b618 100644 --- a/VoidLink/Utility/Utils.m +++ b/VoidLink/Utility/Utils.m @@ -72,12 +72,14 @@ NSString *const deviceName = @"roth"; #endif + (void) addHelpOptionToDialog:(UIAlertController*)dialog { + return;/* #if !TARGET_OS_TV // tvOS doesn't have a browser [dialog addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Help"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ [Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]; }]]; #endif + */ } + (BOOL) parseAddressPortString:(NSString*)addressPort address:(NSRange*)address port:(NSRange*)port { diff --git a/VoidLink/ViewControllers/StreamFrameViewController.m b/VoidLink/ViewControllers/StreamFrameViewController.m index ab3ffeca..aafc2d53 100644 --- a/VoidLink/ViewControllers/StreamFrameViewController.m +++ b/VoidLink/ViewControllers/StreamFrameViewController.m @@ -26,6 +26,7 @@ #import "LocalizationHelper.h" #import "VoidLink-Swift.h" #import "OSCProfilesManager.h" +#import "ThemeManager.h" #include #include @@ -561,7 +562,8 @@ _stageLabel = [[UILabel alloc] init]; [_stageLabel setUserInteractionEnabled:NO]; - [_stageLabel setText:[NSString stringWithFormat:@"Starting %@...", self.streamConfig.appName]]; + // [_stageLabel setText:[NSString stringWithFormat:@"Starting %@...", self.streamConfig.appName]]; + [_stageLabel setText: [LocalizationHelper localizedStringForKey:@"Connecting..."]]; [_stageLabel sizeToFit]; _stageLabel.textAlignment = NSTextAlignmentCenter; _stageLabel.textColor = [UIColor whiteColor]; @@ -681,6 +683,15 @@ object: nil]; #endif + // for compatibility of iOS14 & lower + self.view.backgroundColor = [UIColor systemGrayColor]; + _stageLabel.textColor = [UIColor systemGrayColor]; + _spinner.color = [UIColor systemGrayColor]; + + self.view.backgroundColor = [ThemeManager appBackgroundColor]; + _stageLabel.textColor = [[ThemeManager textColor] colorWithAlphaComponent:0.9]; + _spinner.color = [ThemeManager textColor]; + [self.view addSubview:_stageLabel]; [self.view addSubview:_spinner]; [self.view addSubview:_tipLabel]; @@ -883,6 +894,8 @@ [self.navigationController popToRootViewControllerAnimated:NO]; _extWindow = nil; + + self.mainFrameViewcontroller.settingsExpandedInStreamView = false; // reset this flag to false } // External Screen connected @@ -1033,7 +1046,6 @@ - (void)disconnectRemoteSession { Log(LOG_I, @"Settings view disconnect the session in stream view"); - self.mainFrameViewcontroller.settingsExpandedInStreamView = false; // reset this flag to false [self returnToMainFrame]; } @@ -1143,6 +1155,7 @@ - (void) stageStarting:(const char*)stageName { Log(LOG_I, @"Starting %s", stageName); + return; dispatch_async(dispatch_get_main_queue(), ^{ NSString* lowerCase = [NSString stringWithFormat:@"%s ...", stageName]; NSString* titleCase = [[[lowerCase substringToIndex:1] uppercaseString] stringByAppendingString:[lowerCase substringFromIndex:1]];