Explorar o código

1.下载搜索文件切换磁盘

huangxiaodong hai 1 ano
pai
achega
63f86e97c9

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

@@ -2766,7 +2766,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2845,7 +2845,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 107 - 19
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/downLoadPreviewViewController.m

@@ -24,9 +24,11 @@
 @property (nonatomic, strong) UIButton *rightButton;
 @property (nonatomic, strong) diskListBgView *diskListBgV;
 @property (nonatomic, strong) diskListTableView *diskListTableV;
+@property (nonatomic, strong)  NSMutableArray*diskListArr;
+@property (nonatomic, copy) NSString *defaultDiskPath;
+
 
 @property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
-@property (nonatomic,assign) BOOL didGetType;
 
 @property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
 @end
@@ -77,6 +79,23 @@
         [weakSelf gotoDownloadloadFileRecordFun];
     };
     
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
+    if(diskList && [diskList isKindOfClass:[NSArray class]]){
+        for (cloudPhoneExtraFileModel *model in diskList) {
+            model.isCheckType = NO;
+            [arr addObject:model];
+        }
+    }
+    
+    if(arr.count >0){
+        cloudPhoneExtraFileModel *model = arr.firstObject;
+        model.isCheckType = YES;
+        _defaultDiskPath = model.extraPath;
+    }
+    _diskListArr = arr;
+    [self setTitleAfterGetdiskFun];
 }
 
 - (void)initNavHeadUIFun
@@ -167,13 +186,32 @@
         _diskListBgV.hidden = YES;
         [self.view addSubview:_diskListBgV];
         
+        KWeakSelf
+        _diskListBgV.didTapWhitePlace = ^{
+            [weakSelf hideDiskListVieFun];
+        };
+        
         [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
             make.left.mas_equalTo(0);
             make.bottom.mas_equalTo(0);
             make.right.mas_equalTo(0);
             make.top.mas_equalTo(self.navBarBGView.mas_bottom);
         }];
+        
+        [self.view addSubview:self.diskListTableV];
+        self.diskListTableV.hidden = YES;
+        [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.height.mas_equalTo(3*70);
+            make.right.mas_equalTo(0);
+            make.top.mas_equalTo(self.navBarBGView.mas_bottom);
+        }];
        
+        self.diskListTableV.diskListArr = _diskListArr;
+        
+        self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
+            [weakSelf didCheckDiskFunByPath:checkPath];
+        };
     }
     
     return  _diskListBgV;
@@ -184,8 +222,15 @@
         _diskListTableV = [[diskListTableView alloc] init];
 //
     }
-    
-    return _tableView;
+    return _diskListTableV;
+}
+
+#pragma mark 选中磁盘
+- (void)didCheckDiskFunByPath:(NSString*)pathStr
+{
+    self.defaultDiskPath = pathStr;
+    [self searchFileListFun];
+    [self hideDiskListVieFun];
 }
 
 #pragma mark - 列表委托
@@ -312,10 +357,44 @@
 - (void)selectDiskAction:(UIButton*)but
 {
     if(self.diskListBgV.hidden){
-        self.diskListBgV.hidden = NO;
+        [self showDiskListVieFun];
     }
+    else{
+        [self hideDiskListVieFun];
+        
+    }
+}
+
+- (void)showDiskListVieFun
+{
+    self.diskListBgV.hidden = NO;
+    self.diskListTableV.hidden = NO;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
+        self.diskListTableV.frame = rect;
+
+        self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
+    }];
+}
+
+- (void)hideDiskListVieFun
+{
+    self.diskListBgV.hidden = YES;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        self.diskListTableV.hidden = YES;
+        self.selectTip.transform = CGAffineTransformIdentity;
+        
+    }completion:^(BOOL finished) {
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = 0;
+        self.diskListTableV.frame = rect;
+    }];
 }
 
+
 #pragma mark 刷新底部
 - (void)RefreshBottomViewUIFun
 {
@@ -331,31 +410,40 @@
     _downloadFileBottomV.indexPathsForSelectedItems = selectArr;
 }
 
+
+#pragma mark 设置标题
+- (void)setTitleAfterGetdiskFun
+{
+    if(_isPhotoType){
+        //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
+        [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
+    }
+    else{
+        //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
+        [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
+    }
+    
+    [self searchFileListFun];
+}
+
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
     
-    if(!_didGetType){
-        if(_isPhotoType){
-            //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
-            [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
-        }
-        else{
-            //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
-            [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
-        }
-        
-        [self searchFileListFun];
-        
-        _didGetType = YES;
-    }
     
 }
 
 - (void)searchFileListFun
 {
+    NSMutableDictionary *dict = [NSMutableDictionary new];
     NSNumber *curNum = [NSNumber numberWithBool:_isPhotoType];
-    [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:curNum];/*发送通知*/
+    [dict setObject:curNum forKey:@"type"];
+    if(!_defaultDiskPath){
+        _defaultDiskPath = @"";
+    }
+    [dict setObject:_defaultDiskPath forKey:@"path"];
+    
+    [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:dict];/*发送通知*/
 }
 
 - (void)searchFileListDoneFun:(NSNotification*)notification

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

@@ -10,7 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface diskListBgView : UIView
-
+@property (nonatomic,copy) void (^didTapWhitePlace)(void);
 @end
 
 NS_ASSUME_NONNULL_END

+ 10 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/diskListBgView.m

@@ -21,6 +21,16 @@
 - (void)drawAnyView
 {
     //self.backgroundColor = [UIColor redColor];
+    
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun)];
+    [self addGestureRecognizer:tap];
+}
+
+- (void)didClickTailViewFun
+{
+    if(_didTapWhitePlace){
+        _didTapWhitePlace();
+    }
 }
 
 @end

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

@@ -70,6 +70,7 @@
         make.height.mas_equalTo(28);
         make.centerY.equalTo(cellBgView.mas_centerY);
     }];
+    rightImage.hidden = YES;
     
     checkButton = [[UIButton alloc] init];
     [checkButton setImage:[UIImage imageNamed:@"upload_file_uncheck"] forState:UIControlStateNormal];
@@ -136,6 +137,13 @@
     titleLabel2.text = [[NSString alloc] initWithFormat:@"%.1fGB/%.1fGB",extraAvableSizeF,extraTotalSizeF];
     
     checkButton.selected = curModel.isCheckType;
+    
+    if(checkButton.selected){
+        cellBgView.backgroundColor = [UIColor hwColor:@"#EEFBFF" alpha:1.0];
+    }
+    else{
+        cellBgView.backgroundColor = [UIColor whiteColor];
+    }
 }
 
 - (void)maskSwitchPressed:(UIButton *)maskSwitch{

+ 2 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/diskListTableView.h

@@ -10,7 +10,8 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface diskListTableView : UITableView
-
+@property (nonatomic, strong)  NSMutableArray*diskListArr;
+@property (nonatomic,copy) void (^didClickDiskModel)(NSString* checkPath);
 @end
 
 NS_ASSUME_NONNULL_END

+ 41 - 4
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/diskListTableView.m

@@ -7,6 +7,7 @@
 
 #import "diskListTableView.h"
 #import "diskListTableCell.h"
+#import "cloudPhoneExtraFileListModel.h"
 
 @interface diskListTableView()<UITableViewDataSource,UITableViewDelegate>
 
@@ -43,28 +44,41 @@
     self.delegate = self;
     self.dataSource = self;
     self.separatorStyle = UITableViewCellSeparatorStyleNone;
-    self.backgroundColor = [UIColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0];
+    //self.backgroundColor = [UIColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0];
+    self.backgroundColor = [UIColor clearColor];
 }
 
 
 #pragma mark - uitableviewDelegate
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     static NSString *cellIdentifer = @"diskListTableCell";
-    diskListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer forIndexPath:indexPath];
+    diskListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
     if(cell == nil){
         cell = [[diskListTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifer];
+        cell.accessoryType = UITableViewCellAccessoryNone;
     }
     
+    NSInteger row = indexPath.row;
+    
+    if(row < _diskListArr.count){
+        cloudPhoneExtraFileModel *model = _diskListArr[row];
+        cell.curModel = model;
+    }
+    
+    KWeakSelf
+    cell.didClickSwitch = ^(BOOL SwitchOn) {
+        [weakSelf setModelSelectInRow:row];
+    };
 
     return cell;
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 1;
+    return _diskListArr.count;
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-    return 60.0;
+    return 70.0;
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -73,4 +87,27 @@
 }
 
 
+- (void)setDiskListArr:(NSMutableArray *)diskListArr
+{
+    _diskListArr = diskListArr;
+    [self reloadData];
+}
+
+- (void)setModelSelectInRow:(NSInteger)row
+{
+    for (int i=0; i<_diskListArr.count; i++) {
+        cloudPhoneExtraFileModel *model = _diskListArr[i];
+        model.isCheckType = NO;
+        
+        if(i == row){
+            model.isCheckType = YES;
+            if(_didClickDiskModel){
+                _didClickDiskModel(model.extraPath);
+            }
+        }
+    }
+    
+    [self reloadData];
+}
+
 @end

+ 13 - 2
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -241,7 +241,18 @@
 
 - (void)searchFileListBeginFun:(NSNotification *)notification
 {
-    NSNumber *curNum = [notification object];
+    NSMutableDictionary *objectDict = [notification object];
+    NSNumber *curNum = @1;
+    
+    if ([[objectDict allKeys] containsObject:@"type"]) {
+        curNum = [objectDict objectForKey:@"type"];
+    }
+    
+    NSString *pathStr = @"";
+    
+    if ([[objectDict allKeys] containsObject:@"path"]) {
+        pathStr = [objectDict objectForKey:@"path"];
+    }
     
     NSString *fileType = @"video";
     
@@ -250,7 +261,7 @@
         fileType = @"jpg";
     }
     
-    NSString * commandStr = [RCCommandHelp searchCouldPhoneFilewithType:fileType];
+    NSString * commandStr = [RCCommandHelp searchCouldPhoneFilewithType:fileType withPath:pathStr];
     [self.commandChannelManager rc_sendData:commandStr];
 }
 - (void)searchFileListResponseFun:(NSDictionary *)dataDict

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.h

@@ -223,7 +223,7 @@ NS_ASSUME_NONNULL_BEGIN
  *
  * @param fileType  文件类型 jpg 图片 audio 音频 video 视频 apk 应用 doc 文档 other 其他文件 dir 文件夹
  */
-+ (NSString *)searchCouldPhoneFilewithType:(NSString *)fileType;
++ (NSString *)searchCouldPhoneFilewithType:(NSString *)fileType withPath:(NSString*)pathStr;
 
 /**
  * @brief 下载文件

+ 2 - 2
创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.m

@@ -1060,9 +1060,9 @@
     return dataStr;
 }
 
-+ (NSString *)searchCouldPhoneFilewithType:(NSString *)fileType
++ (NSString *)searchCouldPhoneFilewithType:(NSString *)fileType withPath:(NSString*)pathStr
 {
-    NSString *dataStr =[NSString stringWithFormat:@"{\"data\":{\"fileType\":\"%@\"},\"type\":\"search\"}",fileType];
+    NSString *dataStr =[NSString stringWithFormat:@"{\"data\":{\"fileType\":\"%@\",\"folder\":\"%@\",},\"type\":\"search\"}",fileType,pathStr];
     
     if (USENEWCONTROLLCOMMONDNO500)
     {

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/View/PlayerView.m

@@ -71,7 +71,7 @@ ShowImageViewDelegate>{
                   inRect:CGRectMake(0, 0, glkshowImageView.drawableWidth, glkshowImageView.drawableHeight)
                 fromRect:[ciImage extent]];
     
-    //[self->glkshowImageView display];
+    [self->glkshowImageView display];
 }
 
 - (void)showIMage