Przeglądaj źródła

1.修改磁盘名显示规则

huangxiaodong 1 rok temu
rodzic
commit
3963a17995

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/diskListTableCell.m

@@ -129,7 +129,7 @@
 
 - (void)setCurModel:(cloudPhoneExtraFileModel *)curModel
 {
-    titleLabel.text = curModel.extraPath;
+    titleLabel.text = curModel.name;
     
     CGFloat extraAvableSizeF = curModel.extraAvableSize / 1024.0 /1024.0/1024.0;
     CGFloat extraTotalSizeF = curModel.extraTotalSize / 1024.0 /1024.0/1024.0;

+ 12 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.m

@@ -164,7 +164,18 @@
     }
     
     if(row < _folderListArr.count){
-        cell.titleLabel.text = _folderListArr[row];
+        NSString *name = _folderListArr[row];
+        if([name containsString:@"mnt/media_rw"]){
+            name = [name stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
+        }
+        else if([name containsString:@"storage/emulated/0"]){
+            name = [name stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+        }
+        else if([name containsString:@"sdcard"]){
+            name = [name stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+        }
+        
+        cell.titleLabel.text = name;
         
         if(row == _selectIndex){
             cell.checkButton.selected = YES;

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/filePathCreatTableViewCell.m

@@ -129,7 +129,7 @@
 
 - (void)setCurModel:(cloudPhoneExtraFileModel *)curModel
 {
-    titleLabel.text = curModel.extraPath;
+    titleLabel.text = curModel.name;
     
     CGFloat extraAvableSizeF = curModel.extraAvableSize / 1024.0 /1024.0/1024.0;
     CGFloat extraTotalSizeF = curModel.extraTotalSize / 1024.0 /1024.0/1024.0;

+ 21 - 1
创维盒子/双子星云手机/CloudPlayer/Model/cloudPhoneExtraFileListModel.m

@@ -8,7 +8,27 @@
 #import "cloudPhoneExtraFileListModel.h"
 
 @implementation cloudPhoneExtraFileModel
-
+- (void)setExtraPath:(NSString *)extraPath
+{
+    _extraPath = extraPath;
+    
+    NSArray *arr = [extraPath componentsSeparatedByString:@"/"];
+    if(arr.count > 2){
+        NSString *name = arr.lastObject;
+        if(name.length == 0){
+            name = arr[arr.count -2];
+        }
+        
+        if([name containsString:@"sdcard"]){
+            _name = NSLocalizedString(@"disk_phone_default_tip",nil);
+        }
+        else{
+            _name = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"disk_Extra_default_tip",nil),name];
+        }
+        
+    }
+    
+}
 @end
 
 @implementation cloudPhoneExtraFileListModel

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

@@ -376,3 +376,5 @@
 "disk_not_find_tip"   = "无法找到任务路径";
 "File_upload_set_default_path_tip"   = "请完成上传操作后再更改路径";
 "disk_space_not_tip"   = "磁盘空间不足";
+"disk_phone_default_tip"   = "云机";
+"disk_Extra_default_tip"   = "磁盘";