Commit 3997157636f349504c88ccf26a6f72471cfe817d

Authored by zhangxiaowen
1 parent ccf0fd65

no message

CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingCell.h
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingCell.h
3 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 9 #import <UIKit/UIKit.h>
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingCell.m
... ... @@ -2,18 +2,21 @@
2 2 // CNLiveFontSettingCell.m
3 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 9 #import "CNLiveFontSettingCell.h"
  10 +#import <SDWebImage/SDWebImage.h>
  11 +
  12 +#import "CNLiveBaseKit.h"
  13 +
10 14 #import "CNLiveFontSettingModel.h"
11 15 #import "CNLiveFontSettingFrame.h"
12   -#import "CNLiveBaseKit.h"
13 16 #import "CNLiveFontSettingContentButton.h"
14 17  
15 18 @interface CNLiveFontSettingCell()
16   -@property (nonatomic, strong) UIButton *btnHeadImage;//头像
  19 +@property (nonatomic, strong) UIImageView *headImage;//头像
17 20 @property (nonatomic, strong) CNLiveFontSettingContentButton *btnContent;//显示内容
18 21  
19 22 @end
... ... @@ -26,16 +29,15 @@
26 29 self.backgroundColor = [UIColor clearColor];
27 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 38 self.btnContent = [[CNLiveFontSettingContentButton alloc]init];
37 39 [self.contentView addSubview:self.btnContent];
38   -
  40 +
39 41 }
40 42 return self;
41 43 }
... ... @@ -43,9 +45,14 @@
43 45 #pragma mark - 内容及Frame设置
44 46 - (void)setFontSettingFrame:(CNLiveFontSettingFrame *)fontSettingFrame{
45 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 56 self.btnContent.fontSettingFrame = fontSettingFrame;//这里设置内容的frame等
50 57  
51 58 }
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingContentButton.h
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingContentButton.h
3 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 9 #import <UIKit/UIKit.h>
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingContentButton.m
... ... @@ -2,8 +2,8 @@
2 2 // CNFontSettingContentButton.m
3 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 9 #import "CNLiveFontSettingContentButton.h"
... ... @@ -63,7 +63,7 @@
63 63 [paragraphStyle setLineSpacing:ChatContentLineSpacing];
64 64 [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, FontSetting.content.length)];
65 65 self.content.attributedText = attributedString;
66   -
  66 +
67 67 }
68 68  
69 69 - (BOOL)canBecomeFirstResponder{
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.h
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingController.h
3 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 9 #import <UIKit/UIKit.h>
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingController.m
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingController.m
3 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 9 #import "CNLiveFontSettingController.h"
... ... @@ -30,27 +30,28 @@
30 30 NSInteger tempCoefficient;
31 31 }
32 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 39 [self.data addObject:frame1];
39 40  
40 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 47 [self.data addObject:frame2];
47 48  
48 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 55 [self.data addObject:frame3];
55 56 }
56 57  
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingFrame.h
... ... @@ -2,9 +2,10 @@
2 2 // CNLiveFontSettingFrame.h
3 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 #define ChatMargin 10 //间隔
9 10 #define ChatIconWH 45 //头像宽高height、width
10 11  
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingFrame.m
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingFrame.m
3 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 9 #import "CNLiveFontSettingFrame.h"
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingModel.h
... ... @@ -2,14 +2,15 @@
2 2 // CNLiveFontSettingModel.h
3 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 9 #import <Foundation/Foundation.h>
10 10  
11 11 @interface CNLiveFontSettingModel :NSObject
12 12 @property (nonatomic, copy) NSString *fromMe; //是否自己发的
  13 +@property (nonatomic, copy) NSString *icon; //头像
13 14 @property (nonatomic, copy) NSString *content; //消息内容
14 15  
15 16 @end
... ...
CNLiveSettingModule/Classes/FontSIze/CNLiveFontSettingModel.m
... ... @@ -2,8 +2,8 @@
2 2 // CNLiveFontSettingModel.m
3 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 9 #import "CNLiveFontSettingModel.h"
... ...
Example/CNLiveSettingModule/CNLiveSettingModule-Info.plist
... ... @@ -2,6 +2,11 @@
2 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 3 <plist version="1.0">
4 4 <dict>
  5 + <key>NSAppTransportSecurity</key>
  6 + <dict>
  7 + <key>NSAllowsArbitraryLoads</key>
  8 + <true/>
  9 + </dict>
5 10 <key>CFBundleDevelopmentRegion</key>
6 11 <string>en</string>
7 12 <key>CFBundleDisplayName</key>
... ...