Chris 5 anos atrás
pai
commit
23a9218435
22 arquivos alterados com 6 adições e 912 exclusões
  1. 2 30
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 1 1
      RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h
  3. 0 65
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSButton/KSBorderButton.swift
  4. 0 52
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSButton/KSButton.swift
  5. 1 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSExtension.swift
  6. 0 26
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSLayout.h
  7. 0 18
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerLiteView.h
  8. 0 82
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerLiteView.m
  9. 1 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerSelectIndicator.swift
  10. 0 545
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPickerController.swift
  11. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift
  12. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/Contents.json
  13. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/icon_ImagePicker_Selected@2x.png
  14. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/icon_ImagePicker_Selected@3x.png
  15. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/Contents.json
  16. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/icon_video_pause@2x.png
  17. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/icon_video_pause@3x.png
  18. 0 22
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/Contents.json
  19. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/icon_video_play@2x.png
  20. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/icon_video_play@3x.png
  21. 0 21
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/img_default_placeholder.imageset/Contents.json
  22. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/img_default_placeholder.imageset/img_default_placeholder.png

+ 2 - 30
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -413,9 +413,6 @@
 		BD12B69622B4F72900AEB10B /* KSMediaPickerPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12B69522B4F72900AEB10B /* KSMediaPickerPreviewView.swift */; };
 		BD12B69A22B4FA8400AEB10B /* KSMediaPickerSelectIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12B69922B4FA8400AEB10B /* KSMediaPickerSelectIndicator.swift */; };
 		BD12B69E22B4FAF000AEB10B /* KSMediaPickerNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12B69D22B4FAF000AEB10B /* KSMediaPickerNavigationView.swift */; };
-		BD12B6A222B4FC9B00AEB10B /* KSBorderButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12B6A022B4FC9B00AEB10B /* KSBorderButton.swift */; };
-		BD12B6A322B4FC9B00AEB10B /* KSButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12B6A122B4FC9B00AEB10B /* KSButton.swift */; };
-		BD12B6AB22B502C200AEB10B /* KSVideoPlayerLiteView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD12B6A522B502C200AEB10B /* KSVideoPlayerLiteView.m */; };
 		BD12B6AC22B502C200AEB10B /* KSVideoPlayerBaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD12B6A722B502C200AEB10B /* KSVideoPlayerBaseView.m */; };
 		BD12B6AD22B502C200AEB10B /* KSVideoLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = BD12B6AA22B502C200AEB10B /* KSVideoLayer.m */; };
 		BD13B6B922BA0327008BB323 /* PublishEditController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD13B6B822BA0325008BB323 /* PublishEditController.swift */; };
@@ -479,7 +476,6 @@
 		BD7AB8452284398A0030646A /* OrderPaySelfPickAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8442284398A0030646A /* OrderPaySelfPickAddInfoCell.swift */; };
 		BD929CCA22B8CFB10098C139 /* AliyunPathManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD929CC822B8CFB10098C139 /* AliyunPathManager.m */; };
 		BD929CCE22B904A30098C139 /* PublishViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CCD22B904A30098C139 /* PublishViewController.swift */; };
-		BD929CD222B906AA0098C139 /* PublishMediaPickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */; };
 		BD929CD422B906C10098C139 /* PublishVideoRecorderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */; };
 		BD929CD622B906D10098C139 /* PublishTakePhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */; };
 		BDAA40F7228E947500CF841D /* OrderApplyRefundAccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */; };
@@ -963,15 +959,10 @@
 		BD12B69522B4F72900AEB10B /* KSMediaPickerPreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSMediaPickerPreviewView.swift; sourceTree = "<group>"; };
 		BD12B69922B4FA8400AEB10B /* KSMediaPickerSelectIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSMediaPickerSelectIndicator.swift; sourceTree = "<group>"; };
 		BD12B69D22B4FAF000AEB10B /* KSMediaPickerNavigationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSMediaPickerNavigationView.swift; sourceTree = "<group>"; };
-		BD12B6A022B4FC9B00AEB10B /* KSBorderButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSBorderButton.swift; sourceTree = "<group>"; };
-		BD12B6A122B4FC9B00AEB10B /* KSButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSButton.swift; sourceTree = "<group>"; };
-		BD12B6A522B502C200AEB10B /* KSVideoPlayerLiteView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSVideoPlayerLiteView.m; sourceTree = "<group>"; };
 		BD12B6A622B502C200AEB10B /* KSVideoLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSVideoLayer.h; sourceTree = "<group>"; };
 		BD12B6A722B502C200AEB10B /* KSVideoPlayerBaseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSVideoPlayerBaseView.m; sourceTree = "<group>"; };
-		BD12B6A822B502C200AEB10B /* KSVideoPlayerLiteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSVideoPlayerLiteView.h; sourceTree = "<group>"; };
 		BD12B6A922B502C200AEB10B /* KSVideoPlayerBaseView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSVideoPlayerBaseView.h; sourceTree = "<group>"; };
 		BD12B6AA22B502C200AEB10B /* KSVideoLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSVideoLayer.m; sourceTree = "<group>"; };
-		BD12B6AE22B5076800AEB10B /* KSLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSLayout.h; sourceTree = "<group>"; };
 		BD13B6B822BA0325008BB323 /* PublishEditController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishEditController.swift; sourceTree = "<group>"; };
 		BD13B6BA22BA034C008BB323 /* PublishEditAddPicCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishEditAddPicCell.swift; sourceTree = "<group>"; };
 		BD13B6BB22BA034C008BB323 /* PublishEditAddImgCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishEditAddImgCollectionCell.swift; sourceTree = "<group>"; };
@@ -1040,7 +1031,6 @@
 		BD929CC822B8CFB10098C139 /* AliyunPathManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunPathManager.m; sourceTree = "<group>"; };
 		BD929CC922B8CFB10098C139 /* AliyunPathManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunPathManager.h; sourceTree = "<group>"; };
 		BD929CCD22B904A30098C139 /* PublishViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishViewController.swift; sourceTree = "<group>"; };
-		BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMediaPickerController.swift; sourceTree = "<group>"; };
 		BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishVideoRecorderController.swift; sourceTree = "<group>"; };
 		BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishTakePhotoController.swift; sourceTree = "<group>"; };
 		BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundAccountCell.swift; sourceTree = "<group>"; };
@@ -3687,7 +3677,6 @@
 			isa = PBXGroup;
 			children = (
 				BD929CCD22B904A30098C139 /* PublishViewController.swift */,
-				BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */,
 				BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */,
 				BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */,
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
@@ -3703,10 +3692,8 @@
 			isa = PBXGroup;
 			children = (
 				BD12B6A422B502C200AEB10B /* KSVideoPlayerView */,
-				BD12B6AE22B5076800AEB10B /* KSLayout.h */,
 				BD12B68722B4F28F00AEB10B /* KSExtension.swift */,
 				BD24FABE22B50C4B00C7AA3B /* KSMediaPicker.strings */,
-				BD12B69F22B4FC9B00AEB10B /* KSButton */,
 				BD12B67522B4ECE200AEB10B /* Controller */,
 				BD12B67622B4ED8800AEB10B /* Model */,
 				BD12B67922B4EE1A00AEB10B /* View */,
@@ -3747,24 +3734,13 @@
 			path = View;
 			sourceTree = "<group>";
 		};
-		BD12B69F22B4FC9B00AEB10B /* KSButton */ = {
-			isa = PBXGroup;
-			children = (
-				BD12B6A022B4FC9B00AEB10B /* KSBorderButton.swift */,
-				BD12B6A122B4FC9B00AEB10B /* KSButton.swift */,
-			);
-			path = KSButton;
-			sourceTree = "<group>";
-		};
 		BD12B6A422B502C200AEB10B /* KSVideoPlayerView */ = {
 			isa = PBXGroup;
 			children = (
-				BD12B6A522B502C200AEB10B /* KSVideoPlayerLiteView.m */,
 				BD12B6A622B502C200AEB10B /* KSVideoLayer.h */,
-				BD12B6A722B502C200AEB10B /* KSVideoPlayerBaseView.m */,
-				BD12B6A822B502C200AEB10B /* KSVideoPlayerLiteView.h */,
-				BD12B6A922B502C200AEB10B /* KSVideoPlayerBaseView.h */,
 				BD12B6AA22B502C200AEB10B /* KSVideoLayer.m */,
+				BD12B6A922B502C200AEB10B /* KSVideoPlayerBaseView.h */,
+				BD12B6A722B502C200AEB10B /* KSVideoPlayerBaseView.m */,
 			);
 			path = KSVideoPlayerView;
 			sourceTree = "<group>";
@@ -4471,7 +4447,6 @@
 				A7931E1622AFAEF500297D0A /* TopicSelectionModel.swift in Sources */,
 				BDF47D7E22827C3F00941AB9 /* ProductSlidingTopBottomCollectionViewCell.swift in Sources */,
 				BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */,
-				BD929CD222B906AA0098C139 /* PublishMediaPickerController.swift in Sources */,
 				A7FF1589228C854900A85748 /* OrderDetailBottomView.swift in Sources */,
 				BD1FC1A722B1075F00D55081 /* UIColor+Expanded.m in Sources */,
 				BD12203122AF4A010051C7C2 /* MessageMainItemView.swift in Sources */,
@@ -4577,7 +4552,6 @@
 				BD2FCBE222B21CF70006D974 /* CommunityRecommendController.swift in Sources */,
 				A71AA51F22729F35008FF1A5 /* AuthorizationSwift.swift in Sources */,
 				A7A98E3622802AD7005306E9 /* ShoppingMallBannerFSPagerViewCell.swift in Sources */,
-				BD12B6A222B4FC9B00AEB10B /* KSBorderButton.swift in Sources */,
 				BD12204E22AFB07E0051C7C2 /* MessageThumbController.swift in Sources */,
 				A7824AFD2271EAC900ABA381 /* SelfMentionContactsListTableViewCell.swift in Sources */,
 				BD7AB83F228438290030646A /* OrderPayExpressAddInfoCell.swift in Sources */,
@@ -4744,7 +4718,6 @@
 				A7A98E05227EB891005306E9 /* CategoryViewController.swift in Sources */,
 				A7DF50E322A55AB600998908 /* BrowsePicturesPagerViewCell.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
-				BD12B6A322B4FC9B00AEB10B /* KSButton.swift in Sources */,
 				A7FF1564228C696B00A85748 /* OrderListView.swift in Sources */,
 				A70B2C072284305400B2449F /* ProductModel.swift in Sources */,
 				A7CC74E0227042A4003C4F38 /* MineServiceTableViewCell.swift in Sources */,
@@ -4770,7 +4743,6 @@
 				A7B4E73A228192D20012914A /* CMSTemplateModel.swift in Sources */,
 				A72A72C622321DE000B21995 /* WebView.swift in Sources */,
 				A72A72D122321E2700B21995 /* HTMLURLMacro.swift in Sources */,
-				BD12B6AB22B502C200AEB10B /* KSVideoPlayerLiteView.m in Sources */,
 				BD1FC1A622B1075F00D55081 /* LxButton.m in Sources */,
 				BD12B66922B47D4800AEB10B /* RecommendSubCommentCollectionCell.swift in Sources */,
 				BDF862A1228E41CC000DEF84 /* OrderLogisticsController.swift in Sources */,

+ 1 - 1
RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h

@@ -59,7 +59,7 @@
 
 //  KSMediaPicker所依靠的OC文件
 #import "KSMediaPickerCollectionView.h"
-#import "KSVideoPlayerLiteView.h"
+#import "KSVideoPlayerBaseView.h"
 
 
 #import "AliyunPathManager.h"

+ 0 - 65
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSButton/KSBorderButton.swift

@@ -1,65 +0,0 @@
-//
-//  KSBorderButton.swift
-//  KSMediaPickerDemo
-//
-//  Created by kinsun on 2019/5/8.
-//  Copyright © 2019年 kinsun. All rights reserved.
-//
-
-import UIKit
-
-open class KSBorderButton: KSButton {
-    
-    private var _colors = {() -> [UIControl.State.RawValue: CGColor] in
-        let state = UIControl.State.self
-        return [state.normal.rawValue: UIColor.ks_white.cgColor,
-                state.highlighted.rawValue: UIColor.ks_lightGray.cgColor,
-                state.disabled.rawValue: UIColor.ks_lightGray.cgColor]
-    }()
-    
-    @objc open func setBorderColor(_ borderColor: UIColor?, for state: UIControl.State) {
-        if borderColor == nil {
-            _colors.removeValue(forKey: state.rawValue)
-            if self.state == state {
-                layer.borderColor = UIColor.clear.cgColor
-            }
-        } else {
-            let cgColor = borderColor!.cgColor
-            _colors[state.rawValue] = cgColor
-            if self.state == state {
-                layer.borderColor = cgColor
-            }
-        }
-    }
-    
-    @objc open func borderColor(for state: UIControl.State) -> UIColor? {
-        if let color = _borderColor(for: state) {
-            return UIColor(cgColor: color)
-        } else {
-            return nil
-        }
-    }
-    
-    private func _borderColor(for state: UIControl.State) -> CGColor? {
-        return _colors[state.rawValue]
-    }
-    
-    open override var isEnabled: Bool {
-        didSet {
-            layer.borderColor = _borderColor(for: state) ?? _borderColor(for: .normal)
-        }
-    }
-    
-    open override var isHighlighted: Bool {
-        didSet {
-            layer.borderColor = _borderColor(for: state) ?? _borderColor(for: .normal)
-        }
-    }
-    
-    open override var isSelected: Bool {
-        didSet {
-            layer.borderColor = _borderColor(for: state) ?? _borderColor(for: .normal)
-        }
-    }
-
-}

+ 0 - 52
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSButton/KSButton.swift

@@ -1,52 +0,0 @@
-//
-//  KSButton.swift
-//  KSMediaPickerDemo
-//
-//  Created by kinsun on 2019/5/8.
-//  Copyright © 2019年 kinsun. All rights reserved.
-//
-
-import UIKit
-
-open class KSButton: UIButton {
-    
-    private var _colors = {() -> [UIControl.State.RawValue: UIColor] in
-        let state = UIControl.State.self
-        return [state.normal.rawValue: UIColor.ks_white,
-                state.highlighted.rawValue: UIColor.ks_lightGray,
-                state.disabled.rawValue: UIColor.ks_lightGray]
-    }()
-    
-    @objc open func setBackgroundColor(_ backgroundColor: UIColor?, for state: UIControl.State) {
-        if backgroundColor == nil {
-            _colors.removeValue(forKey: state.rawValue)
-        } else {
-            _colors[state.rawValue] = backgroundColor!
-        }
-        if self.state == state {
-            self.backgroundColor = backgroundColor
-        }
-    }
-    
-    @objc open func backgroundColor(for state: UIControl.State) -> UIColor? {
-        return _colors[state.rawValue]
-    }
-
-    open override var isEnabled: Bool {
-        didSet {
-            backgroundColor = backgroundColor(for: state) ?? backgroundColor(for: .normal)
-        }
-    }
-    
-    open override var isHighlighted: Bool {
-        didSet {
-            backgroundColor = backgroundColor(for: state) ?? backgroundColor(for: .normal)
-        }
-    }
-    
-    open override var isSelected: Bool {
-        didSet {
-            backgroundColor = backgroundColor(for: state) ?? backgroundColor(for: .normal)
-        }
-    }
-}

+ 1 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSExtension.swift

@@ -67,9 +67,7 @@ extension UIView {
     
 }
 
-extension UIImage {
-    
-    static public let ks_defaultPlaceholder = UIImage(named: "img_default_placeholder")!
+extension UIImage {    
     
     public convenience init(JPEGData: Data, of cutSizeProportion: CGSize) {
         let dataRef = CFBridgingRetain(JPEGData) as! CFData

+ 0 - 26
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSLayout.h

@@ -1,26 +0,0 @@
-//
-//  KSLayout.h
-//
-//  Created by kinsun on 2018/10/29.
-//  Copyright © 2018年 kinsun. All rights reserved.
-//
-
-#ifndef KSLayout_h
-#define KSLayout_h
-
-#define k_creatFrameElement     CGFloat viewX=0.f, viewY=0.f, viewW=0.f, viewH=0.f
-#define k_setFrame              (CGRect){viewX, viewY, viewW, viewH}
-#define k_settingFrame(view)    (view).frame = k_setFrame
-#define k_creatWindowSizeElement(width, height) CGFloat windowWidth = (width), windowHeight = (height)
-#define k_creatSizeElementOfSize(size)  k_creatWindowSizeElement((size).width, (size).height)
-#define k_creatSelfSizeElement CGSize kkkk_size = self.bounds.size;\
-k_creatSizeElementOfSize(kkkk_size)
-
-//全局屏幕相关
-#define k_MAIN_SCREEN   UIScreen.mainScreen
-#define k_SCREEN_BOUNDS k_MAIN_SCREEN.bounds
-#define k_SCREEN_WIDTH  k_SCREEN_BOUNDS.size.width
-#define k_SCREEN_HEIGHT k_SCREEN_BOUNDS.size.height
-#define k_SCREEN_SCALE  k_MAIN_SCREEN.scale
-
-#endif /* KSLayout_h */

+ 0 - 18
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerLiteView.h

@@ -1,18 +0,0 @@
-//
-//  KSVideoPlayerLiteView.h
-// 
-//
-//  Created by kinsun on 2019/4/12.
-//
-
-#import "KSVideoPlayerBaseView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface KSVideoPlayerLiteView : KSVideoPlayerBaseView
-
-@property (nonatomic, weak, readonly) UIButton *playButton;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 82
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerLiteView.m

@@ -1,82 +0,0 @@
-//
-//  KSVideoPlayerLiteView.m
-// 
-//
-//  Created by kinsun on 2019/4/12.
-//
-
-#import "KSVideoPlayerLiteView.h"
-
-@interface KSVideoPlayerBaseView ()
-
-- (void)setPlaying:(BOOL)playing;
-
-@end
-
-#import "KSLayout.h"
-
-@implementation KSVideoPlayerLiteView
-
-- (instancetype)initWithFrame:(CGRect)frame {
-    if (self = [super initWithFrame:frame]) {
-        UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-        playButton.imageView.contentMode = UIViewContentModeCenter;
-        [playButton setImage:[UIImage imageNamed:@"icon_video_play"] forState:UIControlStateNormal];
-        [playButton setImage:[UIImage imageNamed:@"icon_video_pause"] forState:UIControlStateSelected];
-        [playButton addTarget:self action:@selector(_clikeCenterButton:) forControlEvents:UIControlEventTouchUpInside];
-        [self addSubview:playButton];
-        _playButton = playButton;
-
-        UITapGestureRecognizer *tap = [UITapGestureRecognizer.alloc initWithTarget:self action:@selector(_didClickVideo)];
-        [self addGestureRecognizer:tap];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    CGSize size = self.bounds.size;
-    k_creatFrameElement;
-    k_creatSizeElementOfSize(size);
-    
-    CGSize k_size = [_playButton sizeThatFits:size];
-    viewW = k_size.width; viewH = k_size.height;
-    viewX = (windowWidth-viewW)*0.5f; viewY = (windowHeight-viewH)*0.5f;
-    k_settingFrame(_playButton);
-}
-
-- (void)_clikeCenterButton:(UIButton *)btn {
-    if (self.isPlaying) {
-        [self pause];//暂停
-    } else {
-        [self play];//播放
-    }
-    btn.selected = self.isPlaying;
-}
-
-- (void)setPlaying:(BOOL)playing {
-    [super setPlaying:playing];
-    _playButton.selected = playing;
-}
-
-- (void)setShowToolsBar:(BOOL)showToolsBar {
-    if (showToolsBar == _playButton.isHidden) {
-        _playButton.hidden = !showToolsBar;
-        CATransition *fade = [CATransition animation];
-        fade.duration = 0.4f;
-        fade.type = kCATransitionFade;
-        [_playButton.layer addAnimation:fade forKey:nil];
-    }
-    [super setShowToolsBar:showToolsBar];
-}
-
-- (void)_didClickVideo {
-    if (self.isPlaying) self.showToolsBar = !self.isShowToolsBar;
-}
-
-- (void)resetViewStatus {
-    [super resetViewStatus];
-    _playButton.selected = NO;
-}
-
-@end

+ 1 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerSelectIndicator.swift

@@ -21,8 +21,7 @@ extension KSMediaPickerViewImageCell {
             normalLayer.backgroundColor = UIColor.ks_black.cgColor
             normalLayer.borderColor = UIColor.ks_white.cgColor
             normalLayer.borderWidth = 1.0
-            normalLayer.masksToBounds = true
-            normalLayer.contents = UIImage(named: "icon_ImagePicker_Selected")?.cgImage
+            normalLayer.masksToBounds = true            
             normalLayer.opacity = 0.5
             return normalLayer
         }()

+ 0 - 545
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPickerController.swift

@@ -1,545 +0,0 @@
-//
-//  PublishMediaPickerController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/6/18.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-//import UIKit
-//import Photos
-//import RxSwift
-//import JXSegmentedView
-//
-//
-//@objc public protocol PublishMediaPickerControllerDelegate: NSObjectProtocol {
-//
-//    @objc optional func mediaPicker(_ mediaPicker: PublishMediaPickerController, didFinishSelected outputArray: [KSMediaPickerOutputModel])
-//}
-//
-//open class PublishMediaPickerController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
-//
-//    @objc public enum mediaType : Int {
-//        case all        = 0
-//        case picture    = 1
-//        case video      = 2
-//    }
-//
-//    @objc public let maxItemCount: UInt
-//    @objc public let maxVideoItemCount: UInt
-//    @objc public let maxPictureItemCount: UInt
-//    @objc public let mediaType: PublishMediaPickerController.mediaType
-//    @objc open weak var delegate: PublishMediaPickerControllerDelegate?
-//
-//    /// 限制单一媒体类型混合显示构造函数,此函数为指定初始化器
-//    ///
-//    /// - Parameters:
-//    ///   - maxVideoItemCount: 选择视频的最大数量
-//    ///   - maxPictureItemCount: 选择图片的最大数量
-//    @objc public init(maxVideoItemCount: UInt, maxPictureItemCount: UInt) {
-//        if maxVideoItemCount == 0 {
-//            self.mediaType = .picture
-//        } else if maxPictureItemCount == 0 {
-//            self.mediaType = .video
-//        } else {
-//            self.mediaType = .all
-//        }
-//        maxItemCount = maxVideoItemCount+maxPictureItemCount
-//        self.maxPictureItemCount = maxPictureItemCount
-//        self.maxVideoItemCount = maxVideoItemCount
-//        super.init(nibName: nil, bundle: nil)
-//    }
-//
-//    /// 自由视频与图片构造函数,就是图片加视频的总数为maxItemCount,不对每种做限制只对总数做限制,此函数为指定初始化器
-//    ///
-//    /// - Parameter maxItemCount: 选择媒体的最大总数
-//    @objc public init(maxItemCount: UInt = 9) {
-//        self.mediaType = .all
-//        self.maxItemCount = maxItemCount
-//        maxPictureItemCount = 0
-//        maxVideoItemCount = 0
-//        super.init(nibName: nil, bundle: nil)
-//    }
-//
-//    @nonobjc required public init?(coder aDecoder: NSCoder) {
-//        fatalError("init(coder:) has not been implemented")
-//    }
-//
-//    private static let k_image_item_class = KSMediaPickerViewImageCell.self
-//    private static let k_video_item_class = KSMediaPickerViewVideoCell.self
-//    private static let k_image_item_iden = NSStringFromClass(k_image_item_class)
-//    private static let k_video_item_iden = NSStringFromClass(k_video_item_class)
-//
-//    override open func loadView() {
-//        let view = KSMediaPickerView()
-//
-//        let nav = view.albumNavigationView
-//        nav.closeButton.addTarget(self, action: #selector(_didClick(closeButton:)), for: .touchUpInside)
-//        nav.nextButton.addTarget(self, action: #selector(_didClick(nextButton:)), for: .touchUpInside)
-//
-//        let classObj = PublishMediaPickerController.self
-//        let collectionView = view.collectionView
-//        collectionView.register(classObj.k_image_item_class, forCellWithReuseIdentifier: classObj.k_image_item_iden)
-//        collectionView.register(classObj.k_video_item_class, forCellWithReuseIdentifier: classObj.k_video_item_iden)
-//        collectionView.delegate = self
-//        collectionView.dataSource = self
-//
-//        let cameraView = view.cameraView
-//        cameraView.didTakePhotoCallback = {[weak self] (cameraView, image) in
-//            self?._didTakePhotoFinish(cameraView: cameraView, image: image)
-//        }
-//        cameraView.didTakeVideoCallback = {[weak self] (cameraView, fileURL) in
-//            self?._didTakeVideoFinish(cameraView: cameraView, fileURL: fileURL)
-//        }
-//        let toolBar = cameraView.toolBar
-//        toolBar.closeButton.addTarget(self, action: #selector(_didClick(closeButton:)), for: .touchUpInside)
-//        toolBar.didChangedStyleCallback = { (style) in
-//            UIApplication.shared.setStatusBarStyle(style == .lightContent ? .lightContent : .default, animated: true)
-//        }
-//        self.view = view
-//    }
-//
-//    override open func viewDidDisappear(_ animated: Bool) {
-//        super.viewDidDisappear(animated)
-//        (view as! KSMediaPickerView).previewView.videoPause()
-//    }
-//
-//    override open func viewDidAppear(_ animated: Bool) {
-//        super.viewDidAppear(animated)
-//        (view as! KSMediaPickerView).previewView.videoPlay()
-//    }
-//
-//    override open func viewDidLoad() {
-//        super.viewDidLoad()
-//        let cancelHandler: ((UIAlertAction) -> Void) = {[weak self] (action) in
-//            self?._didClick(closeButton: nil)
-//        }
-//        PublishMediaPickerController.authorityCheckUp(controller: self, type: .picture, completionHandler: {[weak self] (type) in
-//            if let obj = self {
-//                PublishMediaPickerController.authorityCheckUp(controller: obj, type: .video, completionHandler: { (type) in
-//                    PublishMediaPickerController.authorityAudioCheckUp(controller: obj, completionHandler: {
-//                        DispatchQueue.global().async {
-//                            let assetCollections = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .any, options: nil)
-//                            let regularAssetCollections = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: nil)
-//                            let array = [assetCollections, regularAssetCollections]
-//                            self?._set(assetData: array)
-//                        }
-//                    }, cancelHandler: cancelHandler)
-//                }, cancelHandler: cancelHandler)
-//            }
-//            }, cancelHandler: cancelHandler)
-//    }
-//
-//    private var _albumList: [KSMediaPickerAlbumModel]?
-//
-//    private func _set(assetData: [PHFetchResult<PHAssetCollection>]) {
-//        _albumList = KSMediaPickerAlbumModel.albumModel(from: assetData, mediaType: self.mediaType)
-//        DispatchQueue.main.async(execute: _loadAssetDataFinish)
-//    }
-//
-//    private var _selectedAlbum: KSMediaPickerAlbumModel? {
-//        didSet {
-//            let view = self.view as! KSMediaPickerView
-//            _updateHighlightedItemStatus()
-//            if let itemModel = _selectedAlbum?.assetList.first {
-//                let isStandard = _selectedAssetArray.count == 0 || itemModel == (_selectedAssetArray.firstObject as! KSMediaPickerItemModel)
-//                view.previewView.set(itemModel: itemModel, isStandard: isStandard)
-//                itemModel.isHighlight = true
-//            }
-//            _highlightedItemIndexPath = IndexPath(item: 0, section: 0)
-//            view.collectionView.reloadData()
-//        }
-//    }
-//
-//    private func _loadAssetDataFinish() {
-//        _selectedAlbum = _albumList?.first
-//    }
-//
-//    @objc private func _didClick(closeButton: UIButton?) {
-//        self.dismiss(animated: true, completion: nil)
-//    }
-//
-//    @objc private func _didClick(nextButton: UIButton) {
-//        (view as! KSMediaPickerView).previewView.saveCurrentState()
-//        print("----选择完成,传递_selectedAssetArray")
-//    }
-//
-//    private func _didClickCell(collectionViewCell: KSMediaPickerViewImageCell) -> UInt {
-//        guard let itemModel = collectionViewCell.itemModel, !itemModel.isLoseFocus else {
-//            return 0
-//        }
-//        let indexPath = (view as! KSMediaPickerView).collectionView.indexPath(for: collectionViewCell)
-//        if indexPath != nil {
-//            _updateHighlightItem(at: indexPath!)
-//        }
-//
-//        if itemModel.index > 0 {
-//            return _remove(itemModel: itemModel)
-//        } else {
-//            return _add(itemModel: itemModel)
-//        }
-//    }
-//
-//    private func _didTakePhotoFinish(cameraView: KSMediaPickerCameraView, image: UIImage) {
-//        var createdAssetID: String? = nil
-//        try? PHPhotoLibrary.shared().performChangesAndWait {
-//            let request = PHAssetChangeRequest.creationRequestForAsset(from: image)
-//            createdAssetID = request.placeholderForCreatedAsset?.localIdentifier
-//        }
-//        guard let k_id = createdAssetID,
-//            let asset = PHAsset.fetchAssets(withLocalIdentifiers: [k_id], options: nil).firstObject else {
-//                return
-//        }
-//        _update(asset: asset)
-//    }
-//
-//    private func _didTakeVideoFinish(cameraView: KSMediaPickerCameraView, fileURL: URL) {
-//        var createdAssetID: String? = nil
-//        try? PHPhotoLibrary.shared().performChangesAndWait {
-//            let request = PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: fileURL)
-//            createdAssetID = request?.placeholderForCreatedAsset?.localIdentifier
-//        }
-//        guard let k_id = createdAssetID,
-//            let asset = PHAsset.fetchAssets(withLocalIdentifiers: [k_id], options: nil).firstObject else {
-//                return
-//        }
-//        _update(asset: asset)
-//    }
-//
-//    private func _update(asset: PHAsset) {
-//        _updateHighlightedItemStatus()
-//        let itemModel = KSMediaPickerItemModel(asset)
-//        itemModel.isHighlight = true
-//        _selectedAlbum?.assetList.insert(itemModel, at: 0)
-//        let indexPath = IndexPath(item: 0, section: 0)
-//        _highlightedItemIndexPath = indexPath
-//        let isStandard = _selectedAssetArray.count == 0 || itemModel == (_selectedAssetArray.firstObject as! KSMediaPickerItemModel)
-//        let view = self.view as! KSMediaPickerView
-//        view.previewView.set(itemModel: itemModel, isStandard: isStandard)
-//        let collectionView = view.collectionView
-//        collectionView.performBatchUpdates({
-//            collectionView.insertItems(at: [indexPath])
-//        }) {[weak self] (finished) in
-//            let index = self?._add(itemModel: itemModel) ?? 0
-//            if index > 0 {
-//                itemModel.index = index
-//            } else {
-//                itemModel.isLoseFocus = true
-//            }
-//            collectionView.reloadItems(at: [indexPath])
-//            view.collectionViewScrollToTop()
-//            view.didClick(segmentedControl: view.segmentedControl, index: 0)
-//        }
-//    }
-//
-//    private lazy var _selectedAssetArray = NSMutableArray(capacity: Int(maxItemCount))
-//
-//    private func _add(itemModel: KSMediaPickerItemModel) -> UInt {
-//        let selectedAssetArray = _selectedAssetArray
-//        let count = UInt(selectedAssetArray.count)
-//        var k_maxItemCount = maxItemCount
-//        let assetMediaType = (selectedAssetArray.firstObject as? KSMediaPickerItemModel)?.asset.mediaType ?? itemModel.asset.mediaType
-//        var isSingleType = false
-//        if self.mediaType == .all {
-//            if assetMediaType == .video && maxVideoItemCount != 0 {
-//                k_maxItemCount = maxVideoItemCount
-//                _currentSingleType = .video
-//            } else if assetMediaType == .image && maxPictureItemCount != 0 {
-//                k_maxItemCount = maxPictureItemCount
-//                _currentSingleType = .picture
-//            }
-//            if _currentSingleType != nil && count == 0 {
-//                isSingleType = true
-//            }
-//        }
-//        guard count < k_maxItemCount else {
-//            return 0
-//        }
-//        selectedAssetArray.add(itemModel)
-//        let lastCount = count+1
-//        let isLastItem = lastCount == k_maxItemCount
-//        let view = self.view as! KSMediaPickerView
-//        if isSingleType || isLastItem {
-//            let assetList = _selectedAlbum!.assetList
-//            var indexPaths = Array<IndexPath>()
-//            for (i, k_itemModel) in assetList.enumerated() {
-//                let isOk = (isSingleType && k_itemModel.asset.mediaType != assetMediaType) || (isLastItem && !selectedAssetArray.contains(k_itemModel))
-//                if isOk && !k_itemModel.isLoseFocus {
-//                    k_itemModel.isLoseFocus = true
-//                    let indexPath = IndexPath(item: i, section: 0)
-//                    indexPaths.append(indexPath)
-//                }
-//            }
-//
-//            let collectionView = view.collectionView
-//            collectionView.performBatchUpdates({
-//                collectionView.reloadItems(at: indexPaths)
-//            }, completion: nil)
-//        }
-//        view.albumNavigationView.nextButton.isEnabled = lastCount > 0
-//        return lastCount
-//    }
-//
-//    private var _currentSingleType: PublishMediaPickerController.mediaType?
-//
-//    private func _remove(itemModel: KSMediaPickerItemModel) -> UInt {
-//        let selectedAssetArray = _selectedAssetArray
-//        let index = selectedAssetArray.index(of: itemModel)
-//        let count = selectedAssetArray.count
-//        guard index >= 0, index < count else {
-//            return 0
-//        }
-//        itemModel.index = 0
-//        selectedAssetArray.removeObject(at: index)
-//
-//        let view = self.view as! KSMediaPickerView
-//        let assetMediaType = itemModel.asset.mediaType
-//        var k_maxItemCount = maxItemCount
-//        var needUpdateSingleType = false
-//        let isSingleType = _currentSingleType != nil
-//        if isSingleType {
-//            if _currentSingleType! == .video {
-//                k_maxItemCount = maxVideoItemCount
-//            } else if _currentSingleType! == .picture {
-//                k_maxItemCount = maxPictureItemCount
-//            }
-//            needUpdateSingleType = count == 1
-//        }
-//        let needUpdateIndexNumber = index != count-1
-//        let needUpdateFocus = count == k_maxItemCount
-//        if needUpdateIndexNumber && needUpdateFocus {
-//            let assetList = _selectedAlbum!.assetList
-//            var j = Int(1)
-//            for k_itemModel in assetList {
-//                if selectedAssetArray.contains(k_itemModel) {
-//                    k_itemModel.index = UInt(j)
-//                    j += 1
-//                } else {
-//                    let ok = isSingleType ? (assetMediaType == k_itemModel.asset.mediaType) : true
-//                    if (needUpdateSingleType || (ok && k_itemModel.isLoseFocus)) {
-//                        k_itemModel.isLoseFocus = false
-//                    }
-//                }
-//            }
-//            let collectionView = view.collectionView
-//            collectionView.reloadData()
-//        } else if needUpdateIndexNumber {
-//            let assetList = _selectedAlbum!.assetList as NSArray
-//            let assetListCount = assetList.count
-//            var indexPaths = Array<IndexPath>()
-//            for (i, k_itemModel) in selectedAssetArray.enumerated() {
-//                let l_itemModel = k_itemModel as! KSMediaPickerItemModel
-//                l_itemModel.index = UInt(i+1)
-//                let k_index = assetList.index(of: l_itemModel)
-//                if k_index >= 0 && k_index < assetListCount {
-//                    let indexPath = IndexPath(item: k_index, section: 0)
-//                    indexPaths.append(indexPath)
-//                }
-//            }
-//            let collectionView = view.collectionView
-//            collectionView.performBatchUpdates({
-//                collectionView.reloadItems(at: indexPaths)
-//            }, completion: nil)
-//        } else {
-//            let collectionView = view.collectionView
-//            let assetList = _selectedAlbum!.assetList
-//            if needUpdateSingleType {
-//                for k_itemModel in assetList {
-//                    k_itemModel.isLoseFocus = false
-//                }
-//                collectionView.reloadData()
-//            } else if needUpdateFocus {
-//                var indexPaths = Array<IndexPath>()
-//                for (i, k_itemModel) in assetList.enumerated() {
-//                    let ok = isSingleType ? (assetMediaType == k_itemModel.asset.mediaType) : true
-//                    if (ok && k_itemModel.isLoseFocus) {
-//                        k_itemModel.isLoseFocus = false
-//                        let indexPath = IndexPath(item: i, section: 0)
-//                        indexPaths.append(indexPath)
-//                    }
-//                }
-//                collectionView.performBatchUpdates({
-//                    collectionView.reloadItems(at: indexPaths)
-//                }, completion: nil)
-//            }
-//        }
-//        let albumNavigationView = view.albumNavigationView
-//        albumNavigationView.nextButton.isEnabled = selectedAssetArray.count > 0
-//        return 0
-//    }
-//
-//    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-//        return _selectedAlbum?.assetList.count ?? 0
-//    }
-//
-//    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-//        let itemModel = _selectedAlbum?.assetList[indexPath.item]
-//        let mediaType = itemModel?.asset.mediaType
-//        let isPictureCell = mediaType == .image
-//        let iden = isPictureCell ? PublishMediaPickerController.k_image_item_iden : PublishMediaPickerController.k_video_item_iden
-//        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: iden, for: indexPath) as! KSMediaPickerViewImageCell
-//        if cell.didSelectedItem == nil {
-//            cell.didSelectedItem = {[weak self] (collectionViewCell) -> UInt in
-//                return self?._didClickCell(collectionViewCell: collectionViewCell) ?? 0
-//            }
-//            cell.isMultipleSelected = maxItemCount > 1
-//        }
-//        cell.itemModel = itemModel
-//        return cell
-//    }
-//
-//    private var _highlightedItemIndexPath: IndexPath?
-//
-//    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-//        collectionView.deselectItem(at: indexPath, animated: true)
-//        _updateHighlightItem(at: indexPath)
-//    }
-//
-//    private func _updateHighlightItem(at indexPath: IndexPath) {
-//        let view = self.view as! KSMediaPickerView
-//        guard indexPath != _highlightedItemIndexPath,
-//            let cell = view.collectionView.cellForItem(at: indexPath) as? KSMediaPickerViewImageCell,
-//            let itemModel = cell.itemModel,
-//            !itemModel.isLoseFocus else {
-//                return
-//        }
-//        let isStandard = _selectedAssetArray.count == 0 || itemModel == (_selectedAssetArray.firstObject as! KSMediaPickerItemModel)
-//        let previewView = view.previewView
-//        previewView.set(itemModel: itemModel, isStandard: isStandard)
-//        ///滚动至选择item区域
-//        let collectionView = view.collectionView
-//        let top = collectionView.contentInset.top
-//        var frame = collectionView.frame
-//        frame.origin.y = top
-//        frame.size.height -= top
-//        let cellFrame = cell.frame
-//        let frameInSuper = collectionView.convert(cellFrame, to: view)
-//        if !frame.contains(frameInSuper) {
-//            var point = CGPoint(x: 0.0, y: cellFrame.origin.y-top)
-//            let contentSizeHeight = collectionView.contentSize.height
-//            if cellFrame.maxY >= contentSizeHeight {
-//                point.y = contentSizeHeight-collectionView.bounds.size.height
-//            }
-//            collectionView.setContentOffset(point, animated: true)
-//        }
-//        ///滚动至选择item区域end
-//        view.showPreview(true)
-//
-//        _updateHighlightedItemStatus()
-//
-//        itemModel.isHighlight = true
-//        cell.itemIsHighlight = true
-//        _highlightedItemIndexPath = indexPath
-//    }
-//
-//    private func _updateHighlightedItemStatus() {
-//        guard let indexPath = _highlightedItemIndexPath else {
-//            return
-//        }
-//        let highlightedItemModel: KSMediaPickerItemModel
-//        let highlightedCell = (view as! KSMediaPickerView).collectionView.cellForItem(at: indexPath) as? KSMediaPickerViewImageCell
-//        if highlightedCell == nil {
-//            highlightedItemModel = _selectedAlbum!.assetList[indexPath.item]
-//        } else {
-//            highlightedItemModel = highlightedCell!.itemModel
-//            highlightedCell?.itemIsHighlight = false
-//        }
-//        highlightedItemModel.isHighlight = false
-//    }
-//
-//}
-//
-//extension PublishMediaPickerController {
-//
-//    open class func authorityCheckUp(controller: UIViewController, type: PublishMediaPickerController.mediaType, completionHandler: @escaping ((PublishMediaPickerController.mediaType) -> Void), cancelHandler: ((UIAlertAction) -> Void)?) {
-//        switch type {
-//        case .picture:
-//            let authorization = {(status: PHAuthorizationStatus) in
-//                switch status {
-//                case .authorized:
-//                    completionHandler(type)
-//                    break
-//                case .denied:
-//                    authorityAlert(controller: controller, name: "IMAGE_PICKER_PHOTOS".ks_mediaPickerKeyToLocalized, cancelHandler: cancelHandler)
-//                    break
-//                default:
-//                    break
-//                }
-//            }
-//            let status = PHPhotoLibrary.authorizationStatus()
-//            if status == .notDetermined {
-//                PHPhotoLibrary.requestAuthorization(authorization)
-//            } else {
-//                authorization(status)
-//            }
-//            break
-//        case .video:
-//            let authorization = {(granted: Bool) in
-//                if granted {
-//                    completionHandler(type)
-//                } else {
-//                    authorityAlert(controller: controller, name: "IMAGE_PICKER_CAMERA".ks_mediaPickerKeyToLocalized, cancelHandler: cancelHandler)
-//                }
-//            }
-//            let mediaType = AVMediaType.video
-//            let status = AVCaptureDevice.authorizationStatus(for: mediaType)
-//            if status == .notDetermined {
-//                AVCaptureDevice.requestAccess(for: mediaType, completionHandler: authorization)
-//            } else {
-//                authorization(status == .authorized)
-//            }
-//            break
-//        default :
-//            break
-//        }
-//    }
-//
-//    open class func authorityAlert(controller: UIViewController, name: String, cancelHandler: ((UIAlertAction) -> Void)?) {
-//        let bundle = Bundle.main
-//        let appName = NSLocalizedString("CFBundleDisplayName", tableName: "InfoPlist", bundle: bundle, comment: "")
-//        let title = String(format: "IMAGE_PICKER_NONAUTHORITY_TITLE_FORMAT".ks_mediaPickerKeyToLocalized(in: bundle), name)
-//        let message = String(format: "IMAGE_PICKER_NONAUTHORITY_TIP_FORMAT".ks_mediaPickerKeyToLocalized(in: bundle), appName, name)
-//        let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
-//        let go = UIAlertAction(title: "IMAGE_PICKER_NONAUTHORITY_GO_SETTING".ks_mediaPickerKeyToLocalized(in: bundle), style: .default) { (action) in
-//            let application = UIApplication.shared
-//            let url = URL(string: UIApplication.openSettingsURLString)!
-//            if application.canOpenURL(url) {
-//                if #available(iOS 10.0, *) {
-//                    application.open(url, options: [.universalLinksOnly: false], completionHandler: nil)
-//                } else {
-//                    application.openURL(url)
-//                }
-//                if cancelHandler != nil {
-//                    cancelHandler!(action)
-//                }
-//            }
-//        }
-//        alert.addAction(go)
-//        let cancel = UIAlertAction(title: "CANCEL".ks_mediaPickerKeyToLocalized(in: bundle), style: .cancel, handler: cancelHandler)
-//        alert.addAction(cancel)
-//        controller.present(alert, animated: true, completion: nil)
-//    }
-//
-//    open class func authorityAudioCheckUp(controller: UIViewController, completionHandler: @escaping (() -> Void), cancelHandler: ((UIAlertAction) -> Void)?) {
-//        let authorization = {(granted: Bool) in
-//            if granted {
-//                completionHandler()
-//            } else {
-//                authorityAlert(controller: controller, name: "IMAGE_PICKER_MICROPHONE".ks_mediaPickerKeyToLocalized, cancelHandler: cancelHandler)
-//            }
-//        }
-//        let mediaType = AVMediaType.audio
-//        let status = AVCaptureDevice.authorizationStatus(for: mediaType)
-//        if status == .notDetermined {
-//            AVCaptureDevice.requestAccess(for: mediaType, completionHandler: authorization)
-//        } else {
-//            authorization(status == .authorized)
-//        }
-//    }
-//}
-//
-//extension PublishMediaPickerController : JXSegmentedListContainerViewListDelegate {
-//    func listView() -> UIView {
-//        return view
-//    }
-//}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -162,7 +162,7 @@ extension PublishViewController :JXSegmentedListContainerViewDataSource {
     func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
         switch index {
         case 0:
-            let mediaVc = PublishTakePhotoController()
+            let mediaVc = KSMediaPickerController(maxVideoItemCount: 1, maxPictureItemCount: 9)
             return mediaVc
         case 1:
             let videoVc = PublishVideoRecorderController()

+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/icon_ImagePicker_Selected@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_ImagePicker_Selected.imageset/icon_ImagePicker_Selected@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/icon_video_pause@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_pause.imageset/icon_video_pause@3x.png


+ 0 - 22
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/icon_video_play@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/icon_video_play.imageset/icon_video_play@3x.png


+ 0 - 21
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/img_default_placeholder.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/img_default_placeholder.imageset/img_default_placeholder.png