浏览代码

点击私密分享弹窗需优化

huangxiaodong 10 月之前
父节点
当前提交
0742a47841

+ 10 - 0
创维盒子/双子星云手机/Class/Set/previewFile/imageDetailsScrollViewController.m

@@ -183,6 +183,11 @@
         _editShareV.isPortraitType = _isPortraitType;
     }
     
+    if(_editShareV.secretShareView)
+    {
+        _editShareV.secretShareView.isPortraitType = _isPortraitType;
+    }
+    
     //[_curScrollView.mainView reloadData];
     //[_curScrollView adjustWhenControllerViewWillAppera];
     
@@ -207,6 +212,11 @@
         _editShareV.isPortraitType = _isPortraitType;
     }
     
+    if(_editShareV.secretShareView)
+    {
+        _editShareV.secretShareView.isPortraitType = _isPortraitType;
+    }
+    
     //[_curScrollView.mainView reloadData];
     //[self deletePreviewLandscapeTopMoreViewFun];
 //    if(_index >= 1){

+ 51 - 7
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m

@@ -60,6 +60,8 @@
     
     self.view.backgroundColor = [UIColor blackColor];
     
+    //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDeviceOrientationChange) name:UIDeviceOrientationDidChangeNotification object:nil];
+    
     _bgView = [[UIView alloc] init];
     [self.view addSubview:_bgView];
     
@@ -80,6 +82,7 @@
     /// 播放器相关
     self.player = [[ZFPlayerController alloc] initWithPlayerManager:_playerManager containerView:_bgView];
     self.player.controlView = self.controlView;
+    //self.player.allowOrentitaionRotation = NO;
     
 //    self.player.orientationObserver.supportInterfaceOrientation = ZFInterfaceOrientationMaskLandscape;
 //    [self.player rotateToOrientation:UIInterfaceOrientationLandscapeRight animated:NO completion:nil];
@@ -163,7 +166,7 @@
    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
 
    //添加 设备旋转 通知
-   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChange:)  name:UIDeviceOrientationDidChangeNotification object:nil];
+   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChangeFun)  name:UIDeviceOrientationDidChangeNotification object:nil];
     
     if(_isCodeSuspendVideoType){
         [self.player.currentPlayerManager play];
@@ -200,14 +203,16 @@
 }
 
 /**屏幕旋转的通知回调*/
-- (void)orientChange:(NSNotification *)noti {
+- (void)orientChangeFun {
+    
+    UIDeviceOrientation  orient = [UIDevice currentDevice].orientation; 
     
-    if(_didHandlePortraitType){
+    HLog(@"hxd 333333 orientChangeFun :%d--%ld",_didHandlePortraitType,orient)
+    if(_didHandlePortraitType && orient == UIDeviceOrientationPortrait){
         return;
     }
-    _didHandlePortraitType = YES;
+    _didHandlePortraitType = NO;
     
-    UIDeviceOrientation  orient = [UIDevice currentDevice].orientation;
     switch (orient) {
         case UIDeviceOrientationPortrait:
             HLog(@"竖直屏幕");
@@ -216,6 +221,7 @@
                     [self screenLandscapeToPortraitFun];
                 }];
             }
+            _didHandlePortraitType = YES;
             break;
         case UIDeviceOrientationLandscapeLeft:
             HLog(@"手机左转");
@@ -224,7 +230,7 @@
                     [self screenPortraitToLandscapeFun];
                 }];
             }
-            _didHandlePortraitType = NO;
+            
             break;
         case UIDeviceOrientationPortraitUpsideDown:
            // NSLog(@"手机竖直");
@@ -236,7 +242,6 @@
                     [self screenPortraitToLandscapeFun];
                 }];
             }
-            _didHandlePortraitType = NO;
             break;
         case UIDeviceOrientationUnknown:
             //NSLog(@"未知");
@@ -252,9 +257,30 @@
     }
 }
 
+- (void)handleDeviceOrientationChange
+{
+    HLog(@"hxd 333333")
+    [self orientChangeFun];
+}
 #pragma mark 竖屏转横屏
 - (void)screenPortraitToLandscapeFun{
     _isPortraitType = NO;
+    
+    if(_editShareV.secretShareView)
+    {
+        [_controlView.landScapeControlView addSubview:_editShareV.secretShareView];
+        [_editShareV.secretShareView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.top.mas_equalTo(0);
+        }];
+        
+        _editShareV.isPortraitType = _isPortraitType;
+        _editShareV.secretShareView.isPortraitType = _isPortraitType;
+        return;
+    }
+    
     if(_editShareV){
         _editShareV.isPortraitType = _isPortraitType;
         [_controlView.landScapeControlView addSubview:_editShareV];
@@ -273,6 +299,23 @@
 - (void)screenLandscapeToPortraitFun{
     _isPortraitType = YES;
     
+    if(_editShareV.secretShareView)
+    {
+        [self.view addSubview:_editShareV.secretShareView];
+        
+        [_editShareV.secretShareView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.top.mas_equalTo(0);
+        }];
+        
+        self->_editShareV.isPortraitType = self->_isPortraitType;
+        self->_editShareV.secretShareView.isPortraitType = self->_isPortraitType;
+        
+        return;
+    }
+    
     if(_editShareV){
         _editShareV.isPortraitType = _isPortraitType;
         [self.view addSubview:_editShareV];
@@ -582,6 +625,7 @@
         [_controlView.landScapeControlView addSubview:_editShareV];
     }
     else{
+        _editShareV.isPortraitType = YES;
         [self.view addSubview:_editShareV];
     }
     

+ 2 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/editShareView.h

@@ -7,6 +7,7 @@
 
 #import <UIKit/UIKit.h>
 #import "NASFilePicModel.h"
+#import "shareBySecretView.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface editShareView : UIView
@@ -15,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) BOOL isLastFileType;
 
 @property (nonatomic, assign) BOOL isPortraitType;//竖屏模式
+@property (nonatomic, strong) shareBySecretView *secretShareView;
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/editShareView.m

@@ -605,6 +605,7 @@
         [ksharedAppDelegate.window addSubview:secretView];
     }
     
+    _secretShareView = secretView;
     
     [secretView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);

+ 3 - 1
创维盒子/双子星云手机/Class/Set/previewFile/view/shareBySecretView.m

@@ -389,12 +389,14 @@
     }
     else{
         
+        CGFloat curFullH = SCREEN_H > SCREEN_W ? SCREEN_W :SCREEN_H;
+        
         _whiteBgView.layer.cornerRadius = 0;
         [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
             make.width.mas_equalTo(400);
             make.right.mas_equalTo(0);
             make.bottom.mas_equalTo(0);
-            make.height.mas_equalTo(SCREEN_H);
+            make.height.mas_equalTo(curFullH);
         }];
         
     }