Procházet zdrojové kódy

1.测试后台运行 低电量模式跳转设置页面 --未果

huangxiaodong před 1 rokem
rodič
revize
937eb11657

+ 4 - 4
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -6195,10 +6195,10 @@
 				);
 				INFOPLIST_FILE = "双子星云手机/Info.plist";
 				INFOPLIST_KEY_CFBundleDisplayName = "Private-X";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Private-X将需要使用您的摄像头用于头像拍照";
+				INFOPLIST_KEY_NSCameraUsageDescription = "app need to use Camera ";
 				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSMicrophoneUsageDescription = "Private-X将需要使用您的麦克风";
+				INFOPLIST_KEY_NSMicrophoneUsageDescription = "app need to use Microphone";
 				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Private-X需求使用您的相册保存图片。";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Private-X需求获取您的相册图片。";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -6277,10 +6277,10 @@
 				);
 				INFOPLIST_FILE = "双子星云手机/Info.plist";
 				INFOPLIST_KEY_CFBundleDisplayName = "Private-X";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Private-X将需要使用您的摄像头用于头像拍照";
+				INFOPLIST_KEY_NSCameraUsageDescription = "app need to use Camera ";
 				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSMicrophoneUsageDescription = "Private-X将需要使用您的麦克风";
+				INFOPLIST_KEY_NSMicrophoneUsageDescription = "app need to use Microphone";
 				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Private-X需求使用您的相册保存图片。";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Private-X需求获取您的相册图片。";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

+ 109 - 26
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransfeSetViewController.m

@@ -13,7 +13,7 @@
 //#import "backupsFileManager.h"
 #import "nasBackupsManager.h"
 
-@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource>
+@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource,UITextViewDelegate>
 @property (nonatomic, strong) UITableView *tableView;
 @property (nonatomic, strong) UIView *tailView;
 @property (nonatomic, strong) UILabel *uploadFilePathLabel;
@@ -642,38 +642,89 @@
 
 - (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
     
-    UIView *tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 5+10+20)];
-    if(section==2){
-        tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+30);
-    }
-    
-    UILabel *lab = [[UILabel alloc] init];
-    lab.font = [UIFont systemFontOfSize:12.0];
-    lab.textColor = [UIColor hwColor:@"666666" alpha:1.0];
-    lab.numberOfLines = 0;
-    //lab.backgroundColor = [UIColor redColor];
-    [tailView addSubview:lab];
-    
-    CGFloat height = 20.0;
+    UIView *tailView = [[UIView alloc] init];
+//    if(section==2){
+//        tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+30);
+//    }
     
     if(section==0){
+        tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+20);
+        UILabel *lab = [[UILabel alloc] init];
+        lab.font = [UIFont systemFontOfSize:12.0];
+        lab.textColor = [UIColor hwColor:@"666666" alpha:1.0];
+        lab.numberOfLines = 0;
+        //lab.backgroundColor = [UIColor redColor];
+        [tailView addSubview:lab];
+        CGFloat height = 20.0;
+        
         [lab setText:NSLocalizedString(@"File_Transfer_By_Cellular_tip2",nil)];
+        
+        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            //make.bottom.mas_equalTo(-10);
+            make.height.mas_equalTo(height);
+            make.top.mas_equalTo(5);
+        }];
     }
     else if(section==1){
-        height = 40.0;
-        [lab setText:NSLocalizedString(@"File_Transfer_background_working_tip_2",nil)];
-    }
-    else if(section==2){
-        [lab setText:NSLocalizedString(@"File_Transfer_full_speed_tip",nil)];
+        tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+40.0);
+        
+        UITextView *contentTV = [[UITextView alloc] init];
+        contentTV.backgroundColor = [UIColor clearColor];
+       // contentTV.textColor = [UIColor hwColor:@"#666666"];
+        contentTV.font = [UIFont systemFontOfSize:12.0];
+    //    contentTV.textAlignment = NSTextAlignmentCenter;
+        contentTV.delegate = self;
+        contentTV.editable = NO;        //必须禁止输入,否则点击将弹出输入键盘
+        contentTV.scrollEnabled = NO;
+        [tailView addSubview:contentTV];
+            
+        [contentTV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.bottom.mas_equalTo(0);
+            make.top.mas_equalTo(5);
+        }];
+        
+        // 创建长按手势识别器
+        UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
+        // 设置长按手势的最小按压时间
+        longPress.minimumPressDuration = 0.5; // 2
+        // 将手势识别器添加到视图上
+        [contentTV addGestureRecognizer:longPress];
+
+        NSString *title1 = NSLocalizedString(@"File_Transfer_background_working_tip_2",nil);
+        NSString *title2 = @"";//NSLocalizedString(@"go_setting_title",nil);
+
+
+        NSString *fullTitle = [[NSString alloc] initWithFormat:@"%@ %@",title1,title2];
+        
+        NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:fullTitle];
+        
+        UIColor *noteColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
+        NSRange leftRange = NSMakeRange([fullTitle rangeOfString:title1].location, [fullTitle rangeOfString:title1].length);
+        [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:leftRange];
+        
+//        UIColor *rightColor = [UIColor hwColor:@"#01B7EA" alpha:0.8];
+//        NSRange rightRange = NSMakeRange([fullTitle rangeOfString:title2].location, [fullTitle rangeOfString:title2].length);
+        
+//        [attrStr addAttribute:NSLinkAttributeName
+//                                       value:@"didclick1://"
+//                                       range:rightRange];
+        
+       // [attrStr addAttribute:NSForegroundColorAttributeName value:rightColor range:rightRange];
+        
+        
+        // 设置段落样式以实现水平中间对齐
+//        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+//        paragraphStyle.alignment = NSTextAlignmentLeft; // 水平中间对齐
+//        [attrStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attrStr.length)];
+          
+        
+        contentTV.attributedText = attrStr;
     }
     
-    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.mas_equalTo(15);
-        make.right.mas_equalTo(-15);
-        //make.bottom.mas_equalTo(-10);
-        make.height.mas_equalTo(height);
-        make.top.mas_equalTo(5);
-    }];
     
     return  tailView;
 }
@@ -726,4 +777,36 @@
 //    }
 }
 
+#pragma mark ---- textView Delegate ----
+- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
+{
+    
+    if([[URL scheme] isEqualToString:@"didclick1"]){
+        [self gotoSettingFun];
+        return NO;
+    }
+    
+    return YES;
+    
+}
+
+#pragma mark 拦截长按事件
+- (void)longPress{
+    HLog(@"拦截长按事件")
+}
+
+#pragma mark  跳转设置界面
+- (void)gotoSettingFun
+{
+    // 打开应用的设置页面(不适用于全局设置如低电量模式)
+    NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
+    //NSURL *url = [NSURL URLWithString:@"Prefs:root=BATTERY_USAGE"];
+//    NSURL *url = [NSURL URLWithString:@"Prefs:root=General"];
+//    [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+    if ([[UIApplication sharedApplication] canOpenURL:url]) {
+        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+    } else {
+        HLog(@"无法打开系统设置");
+    }
+}
 @end

+ 30 - 26
创维盒子/双子星云手机/Info.plist

@@ -2,10 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>NSCameraUsageDescription</key>
-	<string>app need to use Camera </string>
-	<key>NSMicrophoneUsageDescription</key>
-	<string>app need to use Microphone</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -59,6 +55,14 @@
 				<string>openPrivacyXApp</string>
 			</array>
 		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>Prefs:</string>
+			</array>
+		</dict>
 	</array>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
@@ -104,7 +108,7 @@
 		<true/>
 		<key>NSExceptionDomains</key>
 		<dict>
-			<key>boxwebrtcservice.phone.armclouding.com</key>
+			<key>14.18.190.138</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -113,7 +117,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>dev-boxwebrtcservice.phone.armclouding.com</key>
+			<key>14.18.190.141</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -122,7 +126,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>privatex.cloud.androidscloud.com</key>
+			<key>boxwebrtcservice.phone.armclouding.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -131,7 +135,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>hiboxde.androidscloud.com</key>
+			<key>dev-boxwebrtcservice.phone.armclouding.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -140,7 +144,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>transfer.androidscloud.com</key>
+			<key>file.phone.androidscloud.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -149,16 +153,16 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>test_zt_ip62.phone.androidscloud.com</key>
+			<key>hiboxde.androidscloud.com</key>
 			<dict>
-				<key>NSIncludesSubdomains</key>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
 				<key>NSExceptionRequiresForwardSecrecy</key>
 				<false/>
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>14.18.190.138</key>
+			<key>hiboxde.armclouding.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -167,16 +171,16 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>transferpre.androidscloud.com</key>
+			<key>privatex.cloud.androidscloud.com</key>
 			<dict>
-				<key>NSIncludesSubdomains</key>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
 				<key>NSExceptionRequiresForwardSecrecy</key>
 				<false/>
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>transfertest.androidscloud.com</key>
+			<key>test_zt_ip62.phone.androidscloud.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -187,14 +191,14 @@
 			</dict>
 			<key>testprivacy.phone.androidscloud.com</key>
 			<dict>
-				<key>NSIncludesSubdomains</key>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
 				<key>NSExceptionRequiresForwardSecrecy</key>
 				<false/>
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>transfer.armclouding.com</key>
+			<key>transfer.androidscloud.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -203,16 +207,16 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>transfertest.armclouding.com</key>
+			<key>transfer.armclouding.com</key>
 			<dict>
-				<key>NSIncludesSubdomains</key>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
 				<key>NSExceptionRequiresForwardSecrecy</key>
 				<false/>
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>14.18.190.141</key>
+			<key>transferpre.androidscloud.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -221,7 +225,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>file.phone.androidscloud.com</key>
+			<key>transfertest.androidscloud.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>
@@ -230,7 +234,7 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
-			<key>hiboxde.armclouding.com</key>
+			<key>transfertest.armclouding.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
 				<true/>

+ 1 - 1
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -634,4 +634,4 @@
 "File_Transfer_background_working_tip_2"   = "开启后台文件传输会使用您的电量。如果您开启了低电量模式,将无法后台传输。若需启用后台运行,请先关闭低电量模式。";
 "mine_cloudPhone_Model_title"   = "云手机模式";
 "cloudPhone_Model_tip"   = "开启后打开APP默认直接进入云手机页面,关闭则进入NAS页面";
-
+"go_setting_title" = "去设置>";