浏览代码

1.图片预览(包括横屏)

huangxiaodong 1 年之前
父节点
当前提交
95f0c6f7ca
共有 14 个文件被更改,包括 507 次插入3 次删除
  1. 24 0
      创维盒子/双子星云手机.xcodeproj/project.pbxproj
  2. 22 0
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/Contents.json
  3. 二进制
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/nas_preview_more_white@2x.png
  4. 二进制
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/nas_preview_more_white@3x.png
  5. 22 0
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/Contents.json
  6. 二进制
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/nas_preview_share_white@2x.png
  7. 二进制
      创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/nas_preview_share_white@3x.png
  8. 34 0
      创维盒子/双子星云手机/Categories/UIInterface+HXRotation.h
  9. 97 0
      创维盒子/双子星云手机/Categories/UIInterface+HXRotation.m
  10. 94 0
      创维盒子/双子星云手机/Class/Set/previewFile/imageDetailsScrollViewController.m
  11. 16 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/previewLandscapeTopMoreView.h
  12. 117 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/previewLandscapeTopMoreView.m
  13. 2 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/previewLandscapeTopView.h
  14. 79 3
      创维盒子/双子星云手机/Class/Set/previewFile/view/previewLandscapeTopView.m

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

@@ -415,6 +415,14 @@
 		6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96322AD2A15A008E349E /* netWorkManager.h */; };
 		6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3F96332AD2A15A008E349E /* netWorkManager.m */; };
 		6B3F963A2AD2AD0B008E349E /* newWorkInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96392AD2AD0B008E349E /* newWorkInterface.h */; };
+		6B42A2112C40DC3D000555BB /* previewLandscapeTopMoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42A20F2C40DC3D000555BB /* previewLandscapeTopMoreView.h */; };
+		6B42A2122C40DC3D000555BB /* previewLandscapeTopMoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B42A2102C40DC3D000555BB /* previewLandscapeTopMoreView.m */; };
+		6B42A2132C40DC3D000555BB /* previewLandscapeTopMoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42A20F2C40DC3D000555BB /* previewLandscapeTopMoreView.h */; };
+		6B42A2142C40DC3D000555BB /* previewLandscapeTopMoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B42A2102C40DC3D000555BB /* previewLandscapeTopMoreView.m */; };
+		6B42A21D2C41040B000555BB /* UIInterface+HXRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42A21B2C41040B000555BB /* UIInterface+HXRotation.h */; };
+		6B42A21E2C41040B000555BB /* UIInterface+HXRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42A21B2C41040B000555BB /* UIInterface+HXRotation.h */; };
+		6B42A21F2C41040B000555BB /* UIInterface+HXRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B42A21C2C41040B000555BB /* UIInterface+HXRotation.m */; };
+		6B42A2202C41040B000555BB /* UIInterface+HXRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B42A21C2C41040B000555BB /* UIInterface+HXRotation.m */; };
 		6B42C1572C2A6C2700936268 /* SYJUISwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42C1542C2A6C2600936268 /* SYJUISwitch.h */; };
 		6B42C1582C2A6C2700936268 /* SYJUISwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B42C1542C2A6C2600936268 /* SYJUISwitch.h */; };
 		6B42C1592C2A6C2700936268 /* SYJUISwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B42C1552C2A6C2600936268 /* SYJUISwitch.m */; };
@@ -1607,6 +1615,10 @@
 		6B3F96322AD2A15A008E349E /* netWorkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = netWorkManager.h; sourceTree = "<group>"; };
 		6B3F96332AD2A15A008E349E /* netWorkManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = netWorkManager.m; sourceTree = "<group>"; };
 		6B3F96392AD2AD0B008E349E /* newWorkInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newWorkInterface.h; sourceTree = "<group>"; };
+		6B42A20F2C40DC3D000555BB /* previewLandscapeTopMoreView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = previewLandscapeTopMoreView.h; sourceTree = "<group>"; };
+		6B42A2102C40DC3D000555BB /* previewLandscapeTopMoreView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewLandscapeTopMoreView.m; sourceTree = "<group>"; };
+		6B42A21B2C41040B000555BB /* UIInterface+HXRotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIInterface+HXRotation.h"; sourceTree = "<group>"; };
+		6B42A21C2C41040B000555BB /* UIInterface+HXRotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIInterface+HXRotation.m"; sourceTree = "<group>"; };
 		6B42C1542C2A6C2600936268 /* SYJUISwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SYJUISwitch.h; sourceTree = "<group>"; };
 		6B42C1552C2A6C2600936268 /* SYJUISwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SYJUISwitch.m; sourceTree = "<group>"; };
 		6B45C4FB2B57BC87007E6911 /* cloudPhoneExtraFileListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cloudPhoneExtraFileListModel.h; sourceTree = "<group>"; };
@@ -2760,6 +2772,8 @@
 				6B7EA7BB2BF759AC002D5CC2 /* shareSecretTableViewCell.m */,
 				6B7E04412C3EA65A004B4948 /* previewLandscapeTopView.h */,
 				6B7E04422C3EA65A004B4948 /* previewLandscapeTopView.m */,
+				6B42A20F2C40DC3D000555BB /* previewLandscapeTopMoreView.h */,
+				6B42A2102C40DC3D000555BB /* previewLandscapeTopMoreView.m */,
 			);
 			path = view;
 			sourceTree = "<group>";
@@ -3220,6 +3234,8 @@
 				A003F6B027D841EE00715CBF /* UIView+HWCategory.m */,
 				A003F6B227D841EE00715CBF /* UITextfield+NLLimit.h */,
 				A003F6AD27D841EE00715CBF /* UITextfield+NLLimit.m */,
+				6B42A21B2C41040B000555BB /* UIInterface+HXRotation.h */,
+				6B42A21C2C41040B000555BB /* UIInterface+HXRotation.m */,
 			);
 			path = Categories;
 			sourceTree = "<group>";
@@ -3663,6 +3679,7 @@
 				6B679DF72C25595700D0DC03 /* mineViewController.h in Headers */,
 				6B05815B2AFC851E00D37290 /* mySetHeadView.h in Headers */,
 				6BF52CAD2AD82EA500A617DB /* PlayerControlButTipView.h in Headers */,
+				6B42A21D2C41040B000555BB /* UIInterface+HXRotation.h in Headers */,
 				6B1FBD2A2B452B3800926382 /* backupsFileManager.h in Headers */,
 				6B5B60652B3D5FD8009A2AE2 /* fileTransfeSetViewController.h in Headers */,
 				6B4D23B12B33DDBC005B718A /* imageVersionRenewTipView.h in Headers */,
@@ -3682,6 +3699,7 @@
 				6B05826F2AFF692700D37290 /* photoPreViewBottomView.h in Headers */,
 				6BA08F4B2C01D05B00A2242D /* CWFileStreamSeparation.h in Headers */,
 				6B7B65582AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h in Headers */,
+				6B42A2112C40DC3D000555BB /* previewLandscapeTopMoreView.h in Headers */,
 				6B7272572B0DAF7600C03F87 /* couldPhoneBaseInfoModel.h in Headers */,
 				186820212AB98600005702A6 /* QRCodeScanViewController.h in Headers */,
 				6B5D40332B4BE358000965CF /* downloadFileBottomView.h in Headers */,
@@ -3909,6 +3927,7 @@
 				6B679DF92C25595700D0DC03 /* mineViewController.h in Headers */,
 				6BD506CC2B9576A4006E7CB0 /* mySetHeadView.h in Headers */,
 				6BD506CD2B9576A4006E7CB0 /* PlayerControlButTipView.h in Headers */,
+				6B42A21E2C41040B000555BB /* UIInterface+HXRotation.h in Headers */,
 				6BD506CE2B9576A4006E7CB0 /* backupsFileManager.h in Headers */,
 				6BD506CF2B9576A4006E7CB0 /* fileTransfeSetViewController.h in Headers */,
 				6BD506D02B9576A4006E7CB0 /* imageVersionRenewTipView.h in Headers */,
@@ -3928,6 +3947,7 @@
 				6BD506D72B9576A4006E7CB0 /* photoPreViewBottomView.h in Headers */,
 				6BA08F4C2C01D05B00A2242D /* CWFileStreamSeparation.h in Headers */,
 				6BD506D82B9576A4006E7CB0 /* PlayerViewController+otherDelegate.h in Headers */,
+				6B42A2132C40DC3D000555BB /* previewLandscapeTopMoreView.h in Headers */,
 				6BD506D92B9576A4006E7CB0 /* couldPhoneBaseInfoModel.h in Headers */,
 				6BD506DA2B9576A4006E7CB0 /* QRCodeScanViewController.h in Headers */,
 				6BD506DB2B9576A4006E7CB0 /* downloadFileBottomView.h in Headers */,
@@ -4487,6 +4507,7 @@
 				6BD5072E2B9576A4006E7CB0 /* HWToolListCell.m in Sources */,
 				6BD5072F2B9576A4006E7CB0 /* cloudPhoneExtraFileListModel.m in Sources */,
 				6B2C1E7F2C070ADE00FDCF82 /* ZFOrientationObserver.m in Sources */,
+				6B42A2202C41040B000555BB /* UIInterface+HXRotation.m in Sources */,
 				6BD507302B9576A4006E7CB0 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
 				6BD507312B9576A4006E7CB0 /* BaseViewController.m in Sources */,
 				6B63179F2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */,
@@ -4499,6 +4520,7 @@
 				6BD507372B9576A4006E7CB0 /* JSONModelError.m in Sources */,
 				6BD507382B9576A4006E7CB0 /* PlayerViewController+otherDelegate.mm in Sources */,
 				6B2C1E632C070ADE00FDCF82 /* ZFKVOController.m in Sources */,
+				6B42A2142C40DC3D000555BB /* previewLandscapeTopMoreView.m in Sources */,
 				6BD507392B9576A4006E7CB0 /* downloadManager.m in Sources */,
 				6BD5073A2B9576A4006E7CB0 /* FMDatabaseQueue.m in Sources */,
 				6B2C1E412C070ADE00FDCF82 /* ZFPortraitControlView.m in Sources */,
@@ -4815,6 +4837,7 @@
 				A084D68E27E859D300054880 /* HWToolListCell.m in Sources */,
 				6B45C4FE2B57BC87007E6911 /* cloudPhoneExtraFileListModel.m in Sources */,
 				6B2C1E7E2C070ADE00FDCF82 /* ZFOrientationObserver.m in Sources */,
+				6B42A21F2C41040B000555BB /* UIInterface+HXRotation.m in Sources */,
 				183AE6512A8A2CF000B11CB0 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
 				A003F6A627D841C800715CBF /* BaseViewController.m in Sources */,
 				6B63179C2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */,
@@ -4827,6 +4850,7 @@
 				183AE6052A89CE3C00B11CB0 /* JSONModelError.m in Sources */,
 				6B7B65592AD9227700BE8CB3 /* PlayerViewController+otherDelegate.mm in Sources */,
 				6B2C1E622C070ADE00FDCF82 /* ZFKVOController.m in Sources */,
+				6B42A2122C40DC3D000555BB /* previewLandscapeTopMoreView.m in Sources */,
 				6B5D40402B4CE40F000965CF /* downloadManager.m in Sources */,
 				A08A950027E9A4E400C544BB /* FMDatabaseQueue.m in Sources */,
 				6B2C1E402C070ADE00FDCF82 /* ZFPortraitControlView.m in Sources */,

+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "nas_preview_more_white@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "nas_preview_more_white@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二进制
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/nas_preview_more_white@2x.png


二进制
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_more_white.imageset/nas_preview_more_white@3x.png


+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "nas_preview_share_white@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "nas_preview_share_white@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二进制
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/nas_preview_share_white@2x.png


二进制
创维盒子/双子星云手机/Assets.xcassets/NAS/nas_preview_share_white.imageset/nas_preview_share_white@3x.png


+ 34 - 0
创维盒子/双子星云手机/Categories/UIInterface+HXRotation.h

@@ -0,0 +1,34 @@
+//
+//  UIInterface+HXRotation.h
+//  HXRotationTool
+//
+//  Created by Mac on 2022/12/9.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIViewController (HXRotation)
+
+/**
+ 尝试将手机旋转为指定方向。请确保传进来的参数属于 -[UIViewController supportedInterfaceOrientations] 返回的范围内,如不在该范围内会旋转失败。
+ @return 旋转成功则返回 YES,旋转失败返回 NO。
+ @note 请注意与 @c hx_setNeedsUpdateOfSupportedInterfaceOrientations 的区别:如果你的界面支持N个方向,而你希望保持对这N个方向的支持的情况下把设备方向旋转为这N个方向里的某一个时,应该调用 @c hx_rotateToInterfaceOrientation: 。如果你的界面支持N个方向,而某些情况下你希望把N换成M并触发设备的方向刷新,则请修改方向后,调用 @c hx_setNeedsUpdateOfSupportedInterfaceOrientations 。
+ */
+- (BOOL)hx_rotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
+
+/**
+ 告知系统当前界面的方向有变化,例如解除横屏锁定,需要刷新(注意:Xcode 13上编译iOS 16并不会主动尝试旋转页面)。
+ 通常在 -[UIViewController supportedInterfaceOrientations] 的值变化后调用。可取代 iOS 16 的同名系统方法。
+ */
+- (void)hx_setNeedsUpdateOfSupportedInterfaceOrientations;
+
+@end
+
+@interface UINavigationController (HXRotation)
+
+@end
+
+
+@interface UITabBarController (HXRotation)
+
+@end

+ 97 - 0
创维盒子/双子星云手机/Categories/UIInterface+HXRotation.m

@@ -0,0 +1,97 @@
+//
+//  UIInterface+HXRotation.m
+//  HXRotationTool
+//
+//  Created by Mac on 2022/12/9.
+//
+
+#import "UIInterface+HXRotation.h"
+
+@implementation UIViewController (HXRotation)
+
+- (BOOL)hx_rotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+    
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000
+    if (@available(iOS 16.0, *)) {
+        [self setNeedsUpdateOfSupportedInterfaceOrientations];
+        __block BOOL result = YES;
+        UIInterfaceOrientationMask mask = 1 << interfaceOrientation;
+        UIWindow *window = self.view.window ?: UIApplication.sharedApplication.delegate.window;
+        [window.windowScene requestGeometryUpdateWithPreferences:[[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:mask] errorHandler:^(NSError * _Nonnull error) {
+            if (error) {
+                result = NO;
+            }
+        }];
+        return result;
+    }
+#endif
+    
+    [[UIDevice currentDevice] setValue:@(interfaceOrientation) forKey:@"orientation"];
+    [UIViewController attemptRotationToDeviceOrientation];
+    
+    return YES;
+}
+
+- (void)hx_setNeedsUpdateOfSupportedInterfaceOrientations {
+    
+    if (@available(iOS 16.0, *)) {
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000
+        [self setNeedsUpdateOfSupportedInterfaceOrientations];
+#else
+        
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+            SEL supportedInterfaceSelector = NSSelectorFromString(@"setNeedsUpdateOfSupportedInterfaceOrientations");
+            [self performSelector:supportedInterfaceSelector];
+#pragma clang diagnostic pop
+        
+#endif
+        });
+        
+    }
+
+}
+
+@end
+
+// UINavigationController
+@implementation UINavigationController (HXRotation)
+
+- (BOOL)shouldAutorotate {
+    return [[self.viewControllers lastObject] shouldAutorotate];
+}
+
+- (NSUInteger)supportedInterfaceOrientations {
+    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
+}
+
+- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+    return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
+}
+
+- (UIViewController *)childViewControllerForStatusBarStyle
+{
+    return [self.viewControllers lastObject];
+}
+
+@end
+
+// UITabBarController
+@implementation UITabBarController (HXRotation)
+
+- (BOOL)shouldAutorotate {
+    return [self.selectedViewController shouldAutorotate];
+}
+
+- (NSUInteger)supportedInterfaceOrientations {
+    return [self.selectedViewController supportedInterfaceOrientations];
+}
+
+- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+    return [self.selectedViewController preferredInterfaceOrientationForPresentation];
+}
+
+@end

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

@@ -11,6 +11,9 @@
 #import "editShareView.h"
 #import "NASFilePicModel.h"
 #import "uploadFileRecordViewController.h"
+#import "previewLandscapeTopView.h"
+#import "previewLandscapeTopMoreView.h"
+#import "UIInterface+HXRotation.h"
 
 @interface imageDetailsScrollViewController ()
 {
@@ -19,6 +22,9 @@
 @property (nonatomic,strong) SDCycleScrollView *curScrollView;
 @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
 @property(nonatomic,assign) BOOL isPortraitType;//竖屏状态
+
+@property(nonatomic,strong) previewLandscapeTopView*previewLandscapeTopV;
+@property(nonatomic,strong) previewLandscapeTopMoreView*previewLandscapeTopMoreV;
 @end
 
 @implementation imageDetailsScrollViewController
@@ -52,6 +58,23 @@
     gl.locations = @[@(0), @(1.0f)];
     //[self.layer addSublayer:gl];
     [self.navBarBGView.layer insertSublayer:gl atIndex:0];
+    
+    //横屏的头部
+    _previewLandscapeTopV = [[previewLandscapeTopView alloc] init];
+    [self.view addSubview:_previewLandscapeTopV];
+    _previewLandscapeTopV.hidden = YES;
+    
+    [_previewLandscapeTopV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.height.mas_equalTo(60);
+    }];
+    
+    KWeakSelf
+    _previewLandscapeTopV.didClickButton = ^(NSInteger tag) {
+        [weakSelf didClickButInLandscapeTopFunBy:tag];
+    };
 }
 
 - (void)viewDidAppear:(BOOL)animated
@@ -135,6 +158,16 @@
     _isPortraitType = NO;
     _curEditTypeBottomView.hidden = YES;
     self.navBarBGView.hidden = YES;
+    
+    _previewLandscapeTopV.hidden = NO;
+    
+    [_previewLandscapeTopV mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.height.mas_equalTo(60);
+    }];
+    
 }
 
 #pragma mark 横屏转竖屏
@@ -143,6 +176,9 @@
     _curEditTypeBottomView.hidden = NO;
     self.navBarBGView.hidden = NO;
     
+    _previewLandscapeTopV.hidden = YES;
+    
+    [self deletePreviewLandscapeTopMoreViewFun];
 }
 
 #pragma mark 用户点击分享
@@ -236,6 +272,7 @@
             [weakSelf showDeleteAlearViewFun];
         }
     };
+    
 }
 
 - (void)setTitleLabelTextFunBy:(NSInteger)index
@@ -243,6 +280,7 @@
     if(index >=0 &&  index < _totalDataArr.count){
         NASFilePicDataArrModel *dataModel = _totalDataArr[index];
         self.titleLabel.text = dataModel.name;
+        _previewLandscapeTopV.titleLabel.text = dataModel.name;
     }
 }
 
@@ -354,4 +392,60 @@
    
     }
 }
+
+#pragma mark 横屏时点击顶部按钮
+- (void)didClickButInLandscapeTopFunBy:(NSInteger)tag
+{
+    if(tag == 1){
+        [self backBtnPressed];
+    }
+    else if(tag == 2){
+        [self showPreviewLandscapeTopMoreViewFun];
+    }
+    else if(tag == 3){//分享
+        [self gotoShareViewFun];
+    }
+}
+
+#pragma mark 删除横屏的 more
+- (void)deletePreviewLandscapeTopMoreViewFun
+{
+    [_previewLandscapeTopMoreV removeFromSuperview];
+    _previewLandscapeTopMoreV = nil;
+}
+
+#pragma mark 点开了横屏的 more
+- (void)showPreviewLandscapeTopMoreViewFun
+{
+    [self deletePreviewLandscapeTopMoreViewFun];
+    
+    _previewLandscapeTopMoreV = [[previewLandscapeTopMoreView alloc] init];
+    [self.view addSubview:_previewLandscapeTopMoreV];
+    
+    [_previewLandscapeTopMoreV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    KWeakSelf
+    _previewLandscapeTopMoreV.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==10){
+            //[[iToast makeText:@"点击下载"] show];
+            //切换到竖屏
+            [weakSelf hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
+            [weakSelf screenLandscapeToPortraitFun];
+            
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                [weakSelf gotoDownLoadFileFun];
+            });
+            
+        }
+        else if(tag==11){
+            //[[iToast makeText:@"点击删除"] show];
+            [weakSelf showDeleteAlearViewFun];
+        }
+    };
+}
 @end

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

@@ -0,0 +1,16 @@
+//
+//  previewLandscapeTopMoreView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/12.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface previewLandscapeTopMoreView : UIView
+@property (nonatomic,copy) void (^didClickButtonFun)(NSInteger tag);
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,117 @@
+//
+//  previewLandscapeTopMoreView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/12.
+//
+
+#import "previewLandscapeTopMoreView.h"
+
+@implementation previewLandscapeTopMoreView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    
+    self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.3];
+    [self drawAnyView];
+    
+    return self;
+}
+
+-(void)drawAnyView
+{
+    //大按钮响应
+    UIButton *bigRightButton = [[UIButton alloc] init];
+    bigRightButton.tag = 1;
+    [bigRightButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self addSubview:bigRightButton];
+    //bigRightButton.backgroundColor= [UIColor greenColor];
+    
+    [bigRightButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor hwColor:@"#333333"];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(65);
+        make.right.mas_equalTo(-16);
+        make.width.mas_equalTo(112);
+        make.height.mas_equalTo(120);
+        //make.height.mas_equalTo(150);
+    }];
+    
+    NSArray *butImageArr = @[@"edit_download_white_icon",@"edit_del_white_icon"];
+    
+    NSArray *butTextArr = @[NSLocalizedString(@"my_set_no_File_download",nil),
+                            NSLocalizedString(@"File_upload_Record_delete",nil)];
+    
+
+    CGFloat butHeight = 50.0;
+   
+    
+    for (int i=0; i<butImageArr.count; i++) {
+        
+        UIButton *but = [[UIButton alloc] init];
+        but.tag = 10+i;
+        [but addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+        NSString *butTitle = [[NSString alloc] initWithFormat:@"   %@",butTextArr[i]];
+        [but setImage:[UIImage imageNamed:butImageArr[i]] forState:UIControlStateNormal];
+        [but setTitle:butTitle forState:UIControlStateNormal];
+        //[but setTitleColor:[UIColor hwColor:@"#0A132B"] forState:UIControlStateNormal];
+        [but setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+        but.titleLabel.font = [UIFont systemFontOfSize:14.0];
+        [whiteBgView addSubview:but];
+        
+        [but mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.height.mas_equalTo(butHeight);
+            make.top.mas_equalTo(10 + butHeight*i);
+        }];
+        
+//        if(i != butImageArr.count -1){
+//            UIView *lineV = [UIView new];
+//            lineV.backgroundColor = [UIColor hwColor:@"#F3F5F9"];
+//            [whiteBgView addSubview:lineV];
+//            
+//            [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
+//                make.left.mas_equalTo(8);
+//                make.right.mas_equalTo(-8);
+//                make.height.mas_equalTo(0.5);
+//                make.top.mas_equalTo(butHeight*(i+1));
+//            }];
+//        }
+        
+    }
+}
+
+#pragma mark 按钮事件
+- (void)didClickButtonFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    HLog(@"%ld",tag);
+    
+    [self removeFun];
+    
+    if(tag == 1){
+        return;
+    }
+    
+    if(_didClickButtonFun){
+        _didClickButtonFun(tag);
+    }
+}
+
+- (void)removeFun
+{
+    [self removeFromSuperview];
+}
+@end

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

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 @interface previewLandscapeTopView : UIView
 @property(nonatomic,strong) UIButton*backButton;
 @property(nonatomic,strong) UILabel *titleLabel;
+
+@property (nonatomic,copy) void (^didClickButton)(NSInteger tag);
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -7,6 +7,11 @@
 
 #import "previewLandscapeTopView.h"
 
+@interface previewLandscapeTopView ()
+@property(nonatomic,strong) UIButton*shareButton;
+@property(nonatomic,strong) UIButton*moreButton;
+@end
+
 @implementation previewLandscapeTopView
 
 - (id)initWithFrame:(CGRect)frame{
@@ -18,11 +23,15 @@
 
 - (void)drawAnyView{
     
-    cg
+    CGFloat curW = SCREEN_W;
+    CGFloat curH = SCREEN_H;
+    if(curW<curH){//横屏宽度最大
+        curW = curH;
+    }
     
     // gradient
     CAGradientLayer *gl = [CAGradientLayer layer];
-    gl.frame = CGRectMake(0,0,SCREEN_W,60);
+    gl.frame = CGRectMake(0,0,curW,60);
     gl.startPoint = CGPointMake(0.5, 0);
     gl.endPoint = CGPointMake(0.5, 1);
     gl.colors = @[(__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.0].CGColor];
@@ -30,7 +39,74 @@
     //[self.layer addSublayer:gl];
     [self.layer insertSublayer:gl atIndex:0];
     
-    backButton
+    _backButton =  [[UIButton alloc] init];
+    _backButton.tag = 1;
+    [_backButton setImage:[UIImage imageNamed:@"icon_white_back"] forState:(UIControlStateNormal)];
+    [_backButton addTarget:self
+                    action:@selector(didClickButtonFun:)
+      forControlEvents:(UIControlEventTouchUpInside)];
+    [self addSubview:_backButton];
+    
+    [_backButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(10);
+        make.width.mas_equalTo(60);
+        make.height.mas_equalTo(60);
+    }];
+   
+    _moreButton =  [[UIButton alloc] init];
+    _moreButton.tag = 2;
+    [_moreButton setImage:[UIImage imageNamed:@"nas_preview_more_white"] forState:(UIControlStateNormal)];
+    [_moreButton addTarget:self
+                    action:@selector(didClickButtonFun:)
+      forControlEvents:(UIControlEventTouchUpInside)];
+    [self addSubview:_moreButton];
+    
+    [_moreButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.right.mas_equalTo(-10);
+        make.width.mas_equalTo(60);
+        make.height.mas_equalTo(60);
+    }];
+    
+    
+    _shareButton =  [[UIButton alloc] init];
+    _shareButton.tag = 3;
+    [_shareButton setImage:[UIImage imageNamed:@"nas_preview_share_white"] forState:(UIControlStateNormal)];
+    [_shareButton addTarget:self
+                    action:@selector(didClickButtonFun:)
+      forControlEvents:(UIControlEventTouchUpInside)];
+    [self addSubview:_shareButton];
+    
+    [_shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.right.equalTo(_moreButton.mas_left).offset(0);
+        make.width.mas_equalTo(60);
+        make.height.mas_equalTo(60);
+    }];
+    
+    
+    _titleLabel = [[UILabel alloc] init];
+    [_titleLabel setTextColor:[UIColor whiteColor]];
+    [_titleLabel setFont:[UIFont boldSystemFontOfSize:18.f]];
+    _titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
+    [self addSubview:_titleLabel];
+    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(self.mas_centerY);
+        make.left.equalTo(_backButton.mas_right).offset(10);
+        make.right.equalTo(_shareButton.mas_left).offset(-10);
+        //make.height.mas_equalTo(25);
+    }];
+    
 }
 
+#pragma mark 按钮点击事件
+- (void)didClickButtonFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    
+    if(_didClickButton){
+        _didClickButton(tag);
+    }
+}
 @end