瀏覽代碼

coverView

Chris 5 年之前
父節點
當前提交
637cd6bbb6

+ 0 - 6
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -436,7 +436,6 @@
 		BD0E678522A4C23B00B980BA /* ShoppingCartOrderPayFreightCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD0E678422A4C23B00B980BA /* ShoppingCartOrderPayFreightCell.swift */; };
 		BD0F61F822CAFC8B004650FB /* CommunityVideoAuthModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD0F61F722CAFC8B004650FB /* CommunityVideoAuthModel.swift */; };
 		BD0FAA3722C465B900DDFB37 /* AliyunEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA3522C465B900DDFB37 /* AliyunEditViewController.m */; };
-		BD0FAA4122C465F500DDFB37 /* AliyunEditButtonsView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA3A22C465F500DDFB37 /* AliyunEditButtonsView.m */; };
 		BD0FAA4222C465F500DDFB37 /* AliyunEffectTimeFilterView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA3C22C465F500DDFB37 /* AliyunEffectTimeFilterView.m */; };
 		BD0FAA4322C465F500DDFB37 /* AlivcCoverImageSelectedView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA3F22C465F500DDFB37 /* AlivcCoverImageSelectedView.m */; };
 		BD0FAA4922C4663100DDFB37 /* AlivcEditItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0FAA4622C4663000DDFB37 /* AlivcEditItemModel.m */; };
@@ -1128,8 +1127,6 @@
 		BD0F61F722CAFC8B004650FB /* CommunityVideoAuthModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoAuthModel.swift; sourceTree = "<group>"; };
 		BD0FAA3522C465B900DDFB37 /* AliyunEditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunEditViewController.m; sourceTree = "<group>"; };
 		BD0FAA3622C465B900DDFB37 /* AliyunEditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunEditViewController.h; sourceTree = "<group>"; };
-		BD0FAA3922C465F500DDFB37 /* AliyunEditButtonsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunEditButtonsView.h; sourceTree = "<group>"; };
-		BD0FAA3A22C465F500DDFB37 /* AliyunEditButtonsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunEditButtonsView.m; sourceTree = "<group>"; };
 		BD0FAA3C22C465F500DDFB37 /* AliyunEffectTimeFilterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunEffectTimeFilterView.m; sourceTree = "<group>"; };
 		BD0FAA3D22C465F500DDFB37 /* AliyunEffectTimeFilterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunEffectTimeFilterView.h; sourceTree = "<group>"; };
 		BD0FAA3F22C465F500DDFB37 /* AlivcCoverImageSelectedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcCoverImageSelectedView.m; sourceTree = "<group>"; };
@@ -4320,8 +4317,6 @@
 		BD0FAA3822C465F500DDFB37 /* View */ = {
 			isa = PBXGroup;
 			children = (
-				BD0FAA3922C465F500DDFB37 /* AliyunEditButtonsView.h */,
-				BD0FAA3A22C465F500DDFB37 /* AliyunEditButtonsView.m */,
 				BD0FAA3B22C465F500DDFB37 /* Filter */,
 				BD0FAA3E22C465F500DDFB37 /* Cover */,
 			);
@@ -6034,7 +6029,6 @@
 				BD7AB8432284390B0030646A /* OrderPaySelfPickInfoCell.swift in Sources */,
 				A7D5F26522C118F100F8E9AF /* CMSMemberListModel.swift in Sources */,
 				BD1FC18622B09F9800D55081 /* CommunitySubCommentController.swift in Sources */,
-				BD0FAA4122C465F500DDFB37 /* AliyunEditButtonsView.m in Sources */,
 				BD6122AD22C3638300D3F513 /* AliyunEffectMusicInfo.m in Sources */,
 				A71CAB3E22CAF57500D908A8 /* CardContentUserDisLikeView.swift in Sources */,
 				A7C0FE0222B682DB00BC1E86 /* CommunityFeaturedTopicsHeaderView.swift in Sources */,

+ 10 - 8
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/Controller/AliyunCoverPickViewController.m

@@ -7,18 +7,16 @@
 //
 
 #import "AliyunCoverPickViewController.h"
-#import "AVC_ShortVideo_Config.h"
 #import "AliyunCoverPickView.h"
 #import "AliyunPublishTopView.h"
 #import "AlivcMacro.h"
 #import "RainbowPlanet-Swift.h"
 
-@interface AliyunCoverPickViewController () <AliyunPublishTopViewDelegate,
-                                             AliyunCoverPickViewDelegate>
+@interface AliyunCoverPickViewController () <AliyunPublishTopViewDelegate, AliyunCoverPickViewDelegate>
 @property(nonatomic, strong) AliyunPublishTopView *topView;
 @property(nonatomic, strong) UIImageView *coverView;
 @property(nonatomic, strong) AliyunCoverPickView *pickView;
-
+@property(nonatomic, strong) UILabel *tipLabel;
 @end
 
 @implementation AliyunCoverPickViewController
@@ -58,12 +56,10 @@
                     initWithFrame:CGRectMake(0, 0, ScreenWidth, StatusBarHeight + 44)];
     [self.topView.cancelButton setImage:[UIImage imageNamed:@"navbar_back_white"]
                                forState:UIControlStateNormal];
-    [self.topView.cancelButton setTitle:nil forState:UIControlStateNormal];
-    [self.topView.finishButton setTitle:@"下一步" forState:UIControlStateNormal];
     self.topView.delegate = self;
     self.topView.delegate = self;
     [self.view addSubview:self.topView];
-
+    
     self.pickView = [[AliyunCoverPickView alloc]
       initWithFrame:CGRectMake(28,
                                ScreenHeight - SafeBottom - pickWith / 8 - 30,
@@ -72,7 +68,13 @@
     self.pickView.videoPath = _videoPath;
     self.pickView.outputSize = _outputSize;
     [self.view addSubview:self.pickView];
-    self.view.backgroundColor = [AliyunIConfig config].backgroundColor;
+    
+    self.tipLabel = [[UILabel alloc] initWithFrame:CGRectMake((ScreenWidth-100)/2, ScreenHeight - SafeBottom - pickWith / 8 - 30 - 20 - 20, 100, 20)];
+    self.tipLabel.text = @"滑动选择封面";
+    self.tipLabel.textColor = [UIColor whiteColor];
+    self.tipLabel.textAlignment = NSTextAlignmentCenter;
+    self.tipLabel.font = [UIFont systemFontOfSize:13];
+    [self.view addSubview:self.tipLabel];
 }
 
 #pragma mark - top view delegate

+ 36 - 41
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/View/AliyunPublishTopView.m

@@ -7,70 +7,65 @@
 //
 
 #import "AliyunPublishTopView.h"
-#import "AVC_ShortVideo_Config.h"
 #import "AlivcMacro.h"
 
 @implementation AliyunPublishTopView
 
 - (instancetype)initWithFrame:(CGRect)frame {
-  self = [super initWithFrame:frame];
-  if (self) {
-    [self setupTopViews];
-  }
-  return self;
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self setupTopViews];
+    }
+    return self;
 }
 
 - (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  self = [super initWithCoder:aDecoder];
-  if (self) {
-    [self setupTopViews];
-  }
-  return self;
+    self = [super initWithCoder:aDecoder];
+    if (self) {
+        [self setupTopViews];
+    }
+    return self;
 }
 
 - (void)setupTopViews {
 
-  UIView *topView = [[UIView alloc] init];
-  topView.frame = CGRectMake(0, 0, ScreenWidth, self.frame.size.height);
-  topView.backgroundColor = [UIColor clearColor];
-  [self addSubview:topView];
+    UIView *topView = [[UIView alloc] init];
+    topView.frame = CGRectMake(0, 0, ScreenWidth, self.frame.size.height);
+    topView.backgroundColor = [UIColor clearColor];
+    [self addSubview:topView];
 
-  UIButton *backButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
-  backButton.frame = CGRectMake(4, StatusBarHeight, 44, 44);
-  [backButton setTitle:NSLocalizedString(@"cancel_camera_import", nil)
-              forState:(UIControlStateNormal)];
-  [backButton setTitleColor:[UIColor whiteColor]
-                   forState:(UIControlStateNormal)];
-  backButton.titleLabel.font = [UIFont systemFontOfSize:14.f];
-  backButton.titleLabel.textAlignment = NSTextAlignmentCenter;
-  [backButton addTarget:self
+    UIButton *backButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
+    backButton.frame = CGRectMake(4, StatusBarHeight, 44, 44);
+    [backButton addTarget:self
                  action:@selector(backButtonAction)
        forControlEvents:(UIControlEventTouchUpInside)];
-  self.cancelButton = backButton;
-  [topView addSubview:backButton];
+    self.cancelButton = backButton;
+    [topView addSubview:backButton];
 
-  UIButton *nextButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
-  nextButton.frame = CGRectMake(ScreenWidth - 44 - 4, StatusBarHeight, 44, 44);
-  [nextButton setTitle:NSLocalizedString(@"finish_subtitle_edit", nil)
-              forState:(UIControlStateNormal)];
-  [nextButton setTitleColor:[UIColor whiteColor]
-                   forState:(UIControlStateNormal)];
-  [nextButton setTitleColor:rgba(110, 118, 139, 1)
-                   forState:(UIControlStateDisabled)];
-  nextButton.titleLabel.font = [UIFont systemFontOfSize:14.f];
-  nextButton.titleLabel.textAlignment = NSTextAlignmentCenter;
-  [nextButton addTarget:self
+    UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    nextButton.frame = CGRectMake(ScreenWidth - 14 - 64, SafeTop + 8, 64, 26);    
+    [nextButton setTitle:@"下一步" forState:(UIControlStateNormal)];
+    nextButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
+    [nextButton setTitleColor:[UIColor whiteColor]
+                     forState:UIControlStateNormal];
+    [nextButton setTitleColor:rgba(110, 118, 139, 1)
+                     forState:(UIControlStateDisabled)];
+    nextButton.backgroundColor = RGBToColor(98, 204, 116);
+    nextButton.layer.cornerRadius = 13;
+    nextButton.layer.masksToBounds = YES;
+    
+    [nextButton addTarget:self
                  action:@selector(nextButtonAction)
        forControlEvents:(UIControlEventTouchUpInside)];
-  self.finishButton = nextButton;
-  [topView addSubview:nextButton];
+    self.finishButton = nextButton;
+    [topView addSubview:nextButton];
 }
 
 - (void)backButtonAction {
-  [self.delegate cancelButtonClicked];
+    [self.delegate cancelButtonClicked];
 }
 
 - (void)nextButtonAction {
-  [self.delegate finishButtonClicked];
+    [self.delegate finishButtonClicked];
 }
 @end

+ 0 - 69
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/View/AliyunEditButtonsView.h

@@ -1,69 +0,0 @@
-//
-//  AliyunEditButtonsView.h
-//  AliyunVideo
-//
-//  Created by Vienta on 2017/3/6.
-//  Copyright (C) 2010-2017 Alibaba Group Holding Limited. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-@class AlivcEditItemModel;
-
-//素材类别 1: 字体 2: 动图 3:imv 4:滤镜 5:音乐 6:字幕 7:动效滤镜
-typedef NS_ENUM(NSInteger, AliyunEditMaterialType) {
-    AliyunEditMaterialTypeFont      = 1,
-    AliyunEditMaterialTypePaster    = 2,
-    AliyunEditMaterialTypeMV        = 3,
-    AliyunEditMaterialTypeFilter    = 4,
-    AliyunEditMaterialTypeMusic     = 5,
-    AliyunEditMaterialTypeTime      = 6,
-};
-
-
-@protocol AliyunEditButtonsViewDelegate <NSObject>
-//滤镜
-- (void)filterButtonClicked:(AliyunEditMaterialType)type;
-
-//音乐
-- (void)musicButtonClicked;
-
-//动图
-- (void)pasterButtonClicked;
-
-//字幕
-- (void)subtitleButtonClicked;
-
-//MV
-- (void)mvButtonClicked:(AliyunEditMaterialType)type;
-
-//音效
-- (void)soundButtonClicked;
-
-//特效
-- (void)effectButtonClicked;
-
-//时间特效
-- (void)timeButtonClicked;
-
-//转场
-- (void)translationButtonCliked;
-
-//涂鸦
-- (void)paintButtonClicked;
-
-//封面选择
-- (void)coverButtonClicked;
-@end
-
-
-
-@interface AliyunEditButtonsView : UIView
-
-- (instancetype)initWithModels:(NSArray <AlivcEditItemModel *>*)models;
-
-@property (nonatomic, weak) id<AliyunEditButtonsViewDelegate> delegate;
-
-@end
-
-
-

+ 0 - 170
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/View/AliyunEditButtonsView.m

@@ -1,170 +0,0 @@
-//
-//  AliyunEditButtonsView.m
-//  AliyunVideo
-//
-//  Created by Vienta on 2017/3/6.
-//  Copyright (C) 2010-2017 Alibaba Group Holding Limited. All rights reserved.
-//
-
-#import "AliyunEditButtonsView.h"
-#import "AlivcEditItemModel.h"
-#import "AlivcMacro.h"
-
-@implementation AliyunEditButtonsView
-
-- (instancetype)initWithModels:(NSArray<AlivcEditItemModel *> *)models{
-    self = [super initWithFrame:CGRectMake(0, ScreenHeight - 70 - SafeBottom, ScreenWidth, 70)];
-    if(self){
-        [self addButtonsWithModels:models];
-        self.backgroundColor = [UIColor clearColor];
-    }
-    return self;
-}
-/**
- 逻辑:在一个屏幕的宽度下,固定放5个半的图标,超出部分以滑动的形式显示
- */
-- (void)addButtonsWithModels:(NSArray<AlivcEditItemModel *> *)models{
-    //滤镜 音乐 动图 字幕 MV 特效 时间特效 转场 涂鸦
-    AlivcEditItemModel *firstModel = models.firstObject;
-    
-    //2个按钮中心之间的间距
-    CGFloat devide = ScreenWidth / 5.5;
-    //基础参数
-//    UIImage *image = firstModel.showImage;
-//    CGFloat buttonWidth = image.size.width;
-    CGFloat buttonWidth = 40;
-    CGFloat labelHeight = 30;
-    CGFloat buttonHeight = buttonWidth + labelHeight;
-
-    //强制宽度等于屏幕宽
-    CGRect frame = self.frame;
-    if (frame.size.width != ScreenWidth) {
-        frame.size.width = ScreenWidth;
-        self.frame = frame;
-    }
-    //添加scrollView
-    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
-    scrollView.contentSize = CGSizeMake(devide * models.count, frame.size.height);
-    scrollView.showsHorizontalScrollIndicator = NO;
-    [self addSubview:scrollView];
-    
-    for (int idx = 0; idx < [models count]; idx++) {
-        AlivcEditItemModel *itemModel = models[idx];
-        UIImage *image = itemModel.showImage;
-        NSString *selName = itemModel.selString;
-        NSString *title = itemModel.title;
-        SEL sel = NSSelectorFromString(selName);
-        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
-        btn.frame = CGRectMake(0, 0, buttonWidth, buttonHeight);
-        [btn addTarget:self action:sel forControlEvents:UIControlEventTouchUpInside];
-        
-        if(image){
-            [btn setImage:image forState:UIControlStateNormal];
-        }
-        
-        [btn setTitle:title forState:UIControlStateNormal];
-        [btn.titleLabel setFont:[UIFont systemFontOfSize:13]];
-        [btn.titleLabel sizeToFit];
-        
-        //
-        CGFloat titleHeight = btn.titleLabel.intrinsicContentSize.height;
-//        CGFloat titleWidth = btn.titleLabel.intrinsicContentSize.width;
-        CGFloat imageWidth = btn.imageView.frame.size.width;
-        CGFloat imageHeight = btn.imageView.frame.size.height;
-        btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, titleHeight + 8, 0);
-        btn.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 8, -imageWidth, 0, 0);
-        [scrollView addSubview:btn];
-        btn.center = CGPointMake((idx+0.5) * devide, frame.size.height / 2);
-        //设置阴影
-        [btn setExclusiveTouch:YES];
-        btn.layer.shadowColor = [UIColor grayColor].CGColor;
-        btn.layer.shadowOpacity = 0.5;
-        btn.layer.shadowOffset = CGSizeMake(1, 1);
-        
-    }
-}
-
-//滤镜
-- (void)filterButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(filterButtonClicked:)]) {
-        [self.delegate filterButtonClicked:AliyunEditMaterialTypeFilter];
-    }
-    
-}
-
-//音乐
-- (void)musicButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(musicButtonClicked)]) {
-        [self.delegate musicButtonClicked];
-    }
-    
-}
-
-//动图
-- (void)pasterButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(pasterButtonClicked)]) {
-        [self.delegate pasterButtonClicked];
-    }
-   
-}
-
-//字幕
-- (void)subtitleButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(subtitleButtonClicked)]) {
-        [self.delegate subtitleButtonClicked];
-    }
-    
-}
-
-//mv
-- (void)mvButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(mvButtonClicked:)]) {
-        [self.delegate mvButtonClicked:AliyunEditMaterialTypeMV];
-    }
-    
-}
-
-//音效
--(void)soundButtonClicked:(id)sender{
-    if (self.delegate && [self.delegate respondsToSelector:@selector(soundButtonClicked)]) {
-        [self.delegate soundButtonClicked];
-    }
-}
-
-//特效
-- (void)effectButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(effectButtonClicked)]) {
-        [self.delegate effectButtonClicked];
-    }
-    
-}
-
-//时间特效
-- (void)timeButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(timeButtonClicked)]) {
-        [self.delegate timeButtonClicked];
-    }
-}
-
-//转场
-- (void)translationButtonCliked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(translationButtonCliked)]) {
-        [self.delegate translationButtonCliked];
-    }
-   
-}
-
-//涂鸦
-- (void)paintButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(paintButtonClicked)]) {
-        [self.delegate paintButtonClicked];
-    }
-}
-
-//封面选择
-- (void)coverButtonClicked:(id)sender {
-    if (self.delegate && [self.delegate respondsToSelector:@selector(coverButtonClicked)]) {
-        [self.delegate coverButtonClicked];
-    }
-}
-@end

二進制
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_ico_speed.imageset/video_ico_speed@3x.png