Commit 3997157636f349504c88ccf26a6f72471cfe817d

Authored by zhangxiaowen
1 parent ccf0fd65

no message

CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingCell.h
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingCell.h 2 // CNLiveFontSettingCell.h
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingCell.m
@@ -2,18 +2,21 @@ @@ -2,18 +2,21 @@
2 // CNLiveFontSettingCell.m 2 // CNLiveFontSettingCell.m
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import "CNLiveFontSettingCell.h" 9 #import "CNLiveFontSettingCell.h"
  10 +#import <SDWebImage/SDWebImage.h>
  11 +
  12 +#import "CNLiveBaseKit.h"
  13 +
10 #import "CNLiveFontSettingModel.h" 14 #import "CNLiveFontSettingModel.h"
11 #import "CNLiveFontSettingFrame.h" 15 #import "CNLiveFontSettingFrame.h"
12 -#import "CNLiveBaseKit.h"  
13 #import "CNLiveFontSettingContentButton.h" 16 #import "CNLiveFontSettingContentButton.h"
14 17
15 @interface CNLiveFontSettingCell() 18 @interface CNLiveFontSettingCell()
16 -@property (nonatomic, strong) UIButton *btnHeadImage;//头像 19 +@property (nonatomic, strong) UIImageView *headImage;//头像
17 @property (nonatomic, strong) CNLiveFontSettingContentButton *btnContent;//显示内容 20 @property (nonatomic, strong) CNLiveFontSettingContentButton *btnContent;//显示内容
18 21
19 @end 22 @end
@@ -26,16 +29,15 @@ @@ -26,16 +29,15 @@
26 self.backgroundColor = [UIColor clearColor]; 29 self.backgroundColor = [UIColor clearColor];
27 self.selectionStyle = UITableViewCellSelectionStyleNone; 30 self.selectionStyle = UITableViewCellSelectionStyleNone;
28 31
29 - self.btnHeadImage = [UIButton buttonWithType:UIButtonTypeCustom];  
30 - self.btnHeadImage.backgroundColor = [UIColor clearColor];  
31 - _btnHeadImage.layer.masksToBounds = YES;  
32 - UIImage *image = [self xw_getImageName:@"font_size_logo" bundleName:@"CNLiveSettingModule" targetClass:[self class]];  
33 - [_btnHeadImage setBackgroundImage:image forState:UIControlStateNormal];  
34 - [self.contentView addSubview:self.btnHeadImage]; 32 + self.headImage = [[UIImageView alloc]init];
  33 + _headImage.backgroundColor = [UIColor clearColor];
  34 + _headImage.layer.masksToBounds = YES;
  35 + _headImage.layer.cornerRadius = 3;
  36 + [self.contentView addSubview:self.headImage];
35 37
36 self.btnContent = [[CNLiveFontSettingContentButton alloc]init]; 38 self.btnContent = [[CNLiveFontSettingContentButton alloc]init];
37 [self.contentView addSubview:self.btnContent]; 39 [self.contentView addSubview:self.btnContent];
38 - 40 +
39 } 41 }
40 return self; 42 return self;
41 } 43 }
@@ -43,9 +45,14 @@ @@ -43,9 +45,14 @@
43 #pragma mark - 内容及Frame设置 45 #pragma mark - 内容及Frame设置
44 - (void)setFontSettingFrame:(CNLiveFontSettingFrame *)fontSettingFrame{ 46 - (void)setFontSettingFrame:(CNLiveFontSettingFrame *)fontSettingFrame{
45 _fontSettingFrame = fontSettingFrame; 47 _fontSettingFrame = fontSettingFrame;
46 - // 设置头像  
47 - self.btnHeadImage.frame = fontSettingFrame.iconFrame;  
48 - // 4、设置内容 48 + CNLiveFontSettingModel *model = fontSettingFrame.model;
  49 +
  50 + // 1.设置头像
  51 + self.headImage.frame = fontSettingFrame.iconFrame;
  52 + UIImage *image = [self xw_getImageName:@"font_size_logo" bundleName:@"CNLiveSettingModule" targetClass:[self class]];
  53 + [_headImage sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:image];
  54 +
  55 + // 2.设置内容
49 self.btnContent.fontSettingFrame = fontSettingFrame;//这里设置内容的frame等 56 self.btnContent.fontSettingFrame = fontSettingFrame;//这里设置内容的frame等
50 57
51 } 58 }
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingContentButton.h
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingContentButton.h 2 // CNLiveFontSettingContentButton.h
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingContentButton.m
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNFontSettingContentButton.m 2 // CNFontSettingContentButton.m
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import "CNLiveFontSettingContentButton.h" 9 #import "CNLiveFontSettingContentButton.h"
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 [paragraphStyle setLineSpacing:ChatContentLineSpacing]; 63 [paragraphStyle setLineSpacing:ChatContentLineSpacing];
64 [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, FontSetting.content.length)]; 64 [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, FontSetting.content.length)];
65 self.content.attributedText = attributedString; 65 self.content.attributedText = attributedString;
66 - 66 +
67 } 67 }
68 68
69 - (BOOL)canBecomeFirstResponder{ 69 - (BOOL)canBecomeFirstResponder{
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.h
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingController.h 2 // CNLiveFontSettingController.h
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/8/21.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.m
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingController.m 2 // CNLiveFontSettingController.m
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/8/21.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import "CNLiveFontSettingController.h" 9 #import "CNLiveFontSettingController.h"
@@ -30,27 +30,28 @@ @@ -30,27 +30,28 @@
30 NSInteger tempCoefficient; 30 NSInteger tempCoefficient;
31 } 31 }
32 - (void)setupDataSource{ 32 - (void)setupDataSource{
33 - CNLiveFontSettingFrame * frame1 = [[CNLiveFontSettingFrame alloc]init];  
34 - CNLiveFontSettingModel * FontSetting1 = [[CNLiveFontSettingModel alloc]init];  
35 - FontSetting1.content = @"预览字体大小";  
36 - FontSetting1.fromMe = @"1";  
37 - frame1.model = FontSetting1; 33 + CNLiveFontSettingFrame *frame1 = [[CNLiveFontSettingFrame alloc]init];
  34 + CNLiveFontSettingModel *model1 = [[CNLiveFontSettingModel alloc]init];
  35 + model1.fromMe = @"1";
  36 + model1.icon = @"http://img.52z.com/upload/news/image/20190201/20190201031140_38468.jpg";
  37 + model1.content = @"预览字体大小";
  38 + frame1.model = model1;
38 [self.data addObject:frame1]; 39 [self.data addObject:frame1];
39 40
40 CNLiveFontSettingFrame * frame2 = [[CNLiveFontSettingFrame alloc]init]; 41 CNLiveFontSettingFrame * frame2 = [[CNLiveFontSettingFrame alloc]init];
41 - CNLiveFontSettingModel * FontSetting2 = [[CNLiveFontSettingModel alloc]init];  
42 - FontSetting2.content = @"拖拽下面的滑块,可设置字体大小";  
43 - FontSetting2.fromMe = @"0";  
44 - frame2.model = FontSetting2;  
45 - 42 + CNLiveFontSettingModel * model2 = [[CNLiveFontSettingModel alloc]init];
  43 + model2.fromMe = @"0";
  44 + model2.icon = @"font_size_logo";
  45 + model2.content = @"拖拽下面的滑块,可设置字体大小";
  46 + frame2.model = model2;
46 [self.data addObject:frame2]; 47 [self.data addObject:frame2];
47 48
48 CNLiveFontSettingFrame * frame3 = [[CNLiveFontSettingFrame alloc]init]; 49 CNLiveFontSettingFrame * frame3 = [[CNLiveFontSettingFrame alloc]init];
49 - CNLiveFontSettingModel * FontSetting3 = [[CNLiveFontSettingModel alloc]init];  
50 - FontSetting3.content = [NSString stringWithFormat:@"设置后,可改变聊天、菜单中的字体大小。如果在使用过程中存在问题或意见,可反馈给%@",@"网家家"];  
51 - FontSetting3.fromMe = @"0";  
52 - frame3.model = FontSetting3;  
53 - 50 + CNLiveFontSettingModel * model3 = [[CNLiveFontSettingModel alloc]init];
  51 + model3.fromMe = @"0";
  52 + model3.icon = @"font_size_logo";
  53 + model3.content = [NSString stringWithFormat:@"设置后,可改变聊天、菜单中的字体大小。如果在使用过程中存在问题或意见,可反馈给%@",@"网家家"];
  54 + frame3.model = model3;
54 [self.data addObject:frame3]; 55 [self.data addObject:frame3];
55 } 56 }
56 57
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingFrame.h
@@ -2,9 +2,10 @@ @@ -2,9 +2,10 @@
2 // CNLiveFontSettingFrame.h 2 // CNLiveFontSettingFrame.h
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
  8 +
8 #define ChatMargin 10 //间隔 9 #define ChatMargin 10 //间隔
9 #define ChatIconWH 45 //头像宽高height、width 10 #define ChatIconWH 45 //头像宽高height、width
10 11
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingFrame.m
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingFrame.m 2 // CNLiveFontSettingFrame.m
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import "CNLiveFontSettingFrame.h" 9 #import "CNLiveFontSettingFrame.h"
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingModel.h
@@ -2,14 +2,15 @@ @@ -2,14 +2,15 @@
2 // CNLiveFontSettingModel.h 2 // CNLiveFontSettingModel.h
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 10
11 @interface CNLiveFontSettingModel :NSObject 11 @interface CNLiveFontSettingModel :NSObject
12 @property (nonatomic, copy) NSString *fromMe; //是否自己发的 12 @property (nonatomic, copy) NSString *fromMe; //是否自己发的
  13 +@property (nonatomic, copy) NSString *icon; //头像
13 @property (nonatomic, copy) NSString *content; //消息内容 14 @property (nonatomic, copy) NSString *content; //消息内容
14 15
15 @end 16 @end
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingModel.m
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 // CNLiveFontSettingModel.m 2 // CNLiveFontSettingModel.m
3 // CNLiveSettingModule 3 // CNLiveSettingModule
4 // 4 //
5 -// Created by open on 2018/9/1.  
6 -// Copyright © 2018年 cnlive. All rights reserved. 5 +// Created by 153993236@qq.com on 11/12/2019.
  6 +// Copyright (c) 2019 153993236@qq.com. All rights reserved.
7 // 7 //
8 8
9 #import "CNLiveFontSettingModel.h" 9 #import "CNLiveFontSettingModel.h"
Example/CNLiveSettingModule/CNLiveSettingModule-Info.plist
@@ -2,6 +2,11 @@ @@ -2,6 +2,11 @@
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0"> 3 <plist version="1.0">
4 <dict> 4 <dict>
  5 + <key>NSAppTransportSecurity</key>
  6 + <dict>
  7 + <key>NSAllowsArbitraryLoads</key>
  8 + <true/>
  9 + </dict>
5 <key>CFBundleDevelopmentRegion</key> 10 <key>CFBundleDevelopmentRegion</key>
6 <string>en</string> 11 <string>en</string>
7 <key>CFBundleDisplayName</key> 12 <key>CFBundleDisplayName</key>