Commit 309568ae0cc3779310b9e3321b2bcc306be37840
1 parent
e98d288e
取消监听歼灭机动画通知
Showing
20 changed files
with
147 additions
and
43 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/BottomToolView/BottomToolView.m
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | @property (nonatomic ,strong) UIButton * _Nullable chatBtn; |
| 14 | 14 | @property (nonatomic ,strong) UIButton * _Nullable privateChatBtn; |
| 15 | 15 | @property (nonatomic ,strong) UIButton * _Nullable giftBtn; |
| 16 | +@property (nonatomic ,strong) UIImageView * _Nullable bgView; | |
| 16 | 17 | |
| 17 | 18 | @end |
| 18 | 19 | |
| ... | ... | @@ -21,6 +22,7 @@ |
| 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame |
| 22 | 23 | { |
| 23 | 24 | if (self = [super initWithFrame:frame]) { |
| 25 | + [self addSubview:self.bgView]; | |
| 24 | 26 | [self addSubview:self.chatBtn]; |
| 25 | 27 | [self addSubview:self.privateChatBtn]; |
| 26 | 28 | [self addSubview:self.giftBtn]; |
| ... | ... | @@ -50,6 +52,16 @@ |
| 50 | 52 | } |
| 51 | 53 | } |
| 52 | 54 | |
| 55 | +- (UIImageView *)bgView | |
| 56 | +{ | |
| 57 | + if (!_bgView) | |
| 58 | + { | |
| 59 | + _bgView = [[UIImageView alloc] initWithFrame:self.bounds]; | |
| 60 | + _bgView.image = [UIImage imageNamed:@"背景400x60"]; | |
| 61 | + } | |
| 62 | + return _bgView; | |
| 63 | +} | |
| 64 | + | |
| 53 | 65 | #pragma mark - getter |
| 54 | 66 | - (UIButton *)chatBtn |
| 55 | 67 | { |
| ... | ... | @@ -71,8 +83,9 @@ |
| 71 | 83 | { |
| 72 | 84 | UIButton *privateChatBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 73 | 85 | privateChatBtn.frame = CGRectMake(self.width*0.5 - 50, (self.height - 45)*0.5, 45, 45); |
| 74 | - [privateChatBtn setBackgroundImage:[UIImage imageNamed:@"privateChat.png"] forState:UIControlStateNormal]; | |
| 75 | - [privateChatBtn setBackgroundImage:[UIImage imageNamed:@"privateChat.png"] forState:UIControlStateHighlighted]; | |
| 86 | + //[UIColor colorWithRed:0.61 green:0.61 blue:0.61 alpha:1.00] | |
| 87 | + [privateChatBtn setBackgroundImage:[UIImage imageNamed:@"22"] forState:UIControlStateNormal]; | |
| 88 | + [privateChatBtn setBackgroundImage:[UIImage imageNamed:@"22"] forState:UIControlStateHighlighted]; | |
| 76 | 89 | [privateChatBtn addTarget:self action:@selector(privateChatAction) forControlEvents:UIControlEventTouchUpInside]; |
| 77 | 90 | _privateChatBtn = privateChatBtn; |
| 78 | 91 | } | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Chat/ChatViews/chatListCell.m
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:self.contentLabel.text]; |
| 48 | 48 | // 设置文字颜色 |
| 49 | 49 | [str addAttribute:NSForegroundColorAttributeName value:ZXRandomColor range:NSMakeRange(0, name.length)]; |
| 50 | - [str addAttribute:NSForegroundColorAttributeName value:[UIColor cyanColor] range:NSMakeRange(name.length, content.length)]; | |
| 50 | + [str addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(name.length, content.length)]; | |
| 51 | 51 | // 将配置好的NSMutableAttributedString传给attributedText属性 |
| 52 | 52 | self.contentLabel.attributedText = str; |
| 53 | 53 | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimOperation.m
| ... | ... | @@ -34,10 +34,11 @@ |
| 34 | 34 | |
| 35 | 35 | GiftAnimOperation *giftAnimOperation = [[GiftAnimOperation alloc]initWithGiftModel:model animContentView:animContentView]; |
| 36 | 36 | |
| 37 | - if (model.giftStyle == GiftStyleFighter) { | |
| 38 | - [[NSNotificationCenter defaultCenter] addObserver:giftAnimOperation selector:@selector(fighterAnimationDidStart) name:NSNotificationAnimationDidStart object:nil]; | |
| 39 | - [[NSNotificationCenter defaultCenter] addObserver:giftAnimOperation selector:@selector(fighterAnimationDidStop) name:NSNotificationAnimationDidStop object:nil]; | |
| 40 | - } | |
| 37 | +// if (model.giftStyle == GiftStyleFighter) { | |
| 38 | +// NSLog(@"add notification op: %@,self %@",giftAnimOperation,self); | |
| 39 | +// [[NSNotificationCenter defaultCenter] addObserver:giftAnimOperation selector:@selector(fighterAnimationDidStart) name:NSNotificationAnimationDidStart object:nil]; | |
| 40 | +// [[NSNotificationCenter defaultCenter] addObserver:giftAnimOperation selector:@selector(fighterAnimationDidStop) name:NSNotificationAnimationDidStop object:nil]; | |
| 41 | +// } | |
| 41 | 42 | return giftAnimOperation; |
| 42 | 43 | } |
| 43 | 44 | |
| ... | ... | @@ -61,6 +62,8 @@ |
| 61 | 62 | 开始方法(KVO控制队列任务状态) |
| 62 | 63 | */ |
| 63 | 64 | - (void)start{ |
| 65 | + NSLog(@"animation start op:%@",self); | |
| 66 | + | |
| 64 | 67 | //这里动画队列任务不存在Cancelled状态所以不需要判断,直接开始执行 |
| 65 | 68 | [self willChangeValueForKey:@"isExecuting"]; |
| 66 | 69 | _executing = YES; |
| ... | ... | @@ -100,6 +103,7 @@ |
| 100 | 103 | |
| 101 | 104 | [self.giftCarView startPorschAnimationWithCompletion:^{ |
| 102 | 105 | |
| 106 | + NSLog(@"animation porsch stop"); | |
| 103 | 107 | [self willChangeValueForKey:@"isFinished"]; |
| 104 | 108 | |
| 105 | 109 | _finished = YES; |
| ... | ... | @@ -117,22 +121,35 @@ |
| 117 | 121 | |
| 118 | 122 | [self.giftFighterView addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 60) endPoint:CGPointMake( -500, 600)]; |
| 119 | 123 | [self.animContentView addSubview:self.giftFighterView]; |
| 120 | - }); | |
| 121 | -} | |
| 124 | + | |
| 125 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(12 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 126 | + [self willChangeValueForKey:@"isFinished"]; | |
| 127 | + | |
| 128 | + _finished = YES; | |
| 129 | + | |
| 130 | + [self didChangeValueForKey:@"isFinished"]; | |
| 122 | 131 | |
| 123 | -- (void)fighterAnimationDidStart | |
| 124 | -{ | |
| 125 | - | |
| 132 | + }); | |
| 133 | + }); | |
| 126 | 134 | } |
| 127 | 135 | |
| 128 | -- (void)fighterAnimationDidStop | |
| 129 | -{ | |
| 130 | - [self willChangeValueForKey:@"isFinished"]; | |
| 131 | - | |
| 132 | - _finished = YES; | |
| 133 | - | |
| 134 | - [self didChangeValueForKey:@"isFinished"]; | |
| 135 | -} | |
| 136 | +//- (void)fighterAnimationDidStart | |
| 137 | +//{ | |
| 138 | +// NSLog(@"fight start op:%@",self); | |
| 139 | +//} | |
| 140 | +// | |
| 141 | +//- (void)fighterAnimationDidStop | |
| 142 | +//{ | |
| 143 | +// NSLog(@"fight stop op:%@",self); | |
| 144 | +// [self willChangeValueForKey:@"isFinished"]; | |
| 145 | +// | |
| 146 | +// _finished = YES; | |
| 147 | +// | |
| 148 | +// [self didChangeValueForKey:@"isFinished"]; | |
| 149 | +// | |
| 150 | +//// [[NSNotificationCenter defaultCenter] removeObserver:self name:NSNotificationAnimationDidStart object:nil]; | |
| 151 | +//// [[NSNotificationCenter defaultCenter] removeObserver:self name:NSNotificationAnimationDidStop object:nil]; | |
| 152 | +////} | |
| 136 | 153 | |
| 137 | 154 | - (void)planeAnimation |
| 138 | 155 | { |
| ... | ... | @@ -145,6 +162,7 @@ |
| 145 | 162 | |
| 146 | 163 | [self.giftPlaneView startPlaneAnimationWithCompletion:^{ |
| 147 | 164 | |
| 165 | + NSLog(@"animation plane stop"); | |
| 148 | 166 | [self willChangeValueForKey:@"isFinished"]; |
| 149 | 167 | |
| 150 | 168 | _finished = YES; | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimationAction.m
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | */ |
| 16 | 16 | - (void)startPorschAnimationWithCompletion:(giftAnimationCompletion)Completion |
| 17 | 17 | { |
| 18 | + NSLog(@"animation PorschStart"); | |
| 18 | 19 | _giftAnimationCompletion = Completion; |
| 19 | 20 | } |
| 20 | 21 | |
| ... | ... | @@ -23,6 +24,7 @@ |
| 23 | 24 | */ |
| 24 | 25 | - (void)startPlaneAnimationWithCompletion:(giftAnimationCompletion)Completion |
| 25 | 26 | { |
| 27 | + NSLog(@"animation PlaneStart"); | |
| 26 | 28 | _giftAnimationCompletion = Completion; |
| 27 | 29 | } |
| 28 | 30 | |
| ... | ... | @@ -33,6 +35,7 @@ |
| 33 | 35 | @param flag 是否完成标记 |
| 34 | 36 | */ |
| 35 | 37 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ |
| 38 | + NSLog(@"animationDidStop"); | |
| 36 | 39 | _giftAnimationCompletion(); |
| 37 | 40 | } |
| 38 | 41 | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHCarViews.m
| ... | ... | @@ -101,12 +101,12 @@ |
| 101 | 101 | animationGroup.animations = @[position,scaleAnimation]; |
| 102 | 102 | |
| 103 | 103 | if (self.animations.count == 0) { |
| 104 | - NSLog(@"第一次动画%ld",self.animations.count); | |
| 104 | +// NSLog(@"第一次动画%ld",self.animations.count); | |
| 105 | 105 | [self.animations addObject:animationGroup]; |
| 106 | 106 | [self.layer addAnimation:animationGroup forKey:@"carView"]; |
| 107 | 107 | }else{ |
| 108 | 108 | [self.animations addObject:animationGroup]; |
| 109 | - NSLog(@"添加动画"); | |
| 109 | +// NSLog(@"添加动画"); | |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| ... | ... | @@ -139,7 +139,7 @@ |
| 139 | 139 | [self removeFromSuperview]; |
| 140 | 140 | |
| 141 | 141 | _giftAnimationCompletion(); |
| 142 | - NSLog(@"删除动画"); | |
| 142 | +// NSLog(@"删除动画"); | |
| 143 | 143 | // [self.animations removeObjectAtIndex:0]; |
| 144 | 144 | |
| 145 | 145 | if (self.animations.count > 0) { | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHFighterView+animDelegagte.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHFighterView+animDelegagte.m
| ... | ... | @@ -9,16 +9,23 @@ |
| 9 | 9 | #import "NHFighterView+animDelegagte.h" |
| 10 | 10 | #import "GiftAnimationAction.h" |
| 11 | 11 | |
| 12 | + | |
| 13 | + | |
| 12 | 14 | @implementation NHFighterView (animDelegagte) |
| 13 | 15 | |
| 14 | -- (void)animationDidStart:(CAAnimation *)anim | |
| 15 | -{ | |
| 16 | - [[NSNotificationCenter defaultCenter] postNotificationName:NSNotificationAnimationDidStart object:nil]; | |
| 17 | -} | |
| 16 | +//@dynamic completion; | |
| 18 | 17 | |
| 19 | -- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag | |
| 20 | -{ | |
| 21 | - [[NSNotificationCenter defaultCenter] postNotificationName:NSNotificationAnimationDidStop object:nil]; | |
| 22 | -} | |
| 18 | +//- (void)animationDidStart:(CAAnimation *)anim | |
| 19 | +//{ | |
| 20 | +//// [[NSNotificationCenter defaultCenter] postNotificationName:NSNotificationAnimationDidStart object:nil]; | |
| 21 | +// NSLog(@"fighter start:%@",self); | |
| 22 | +//} | |
| 23 | +// | |
| 24 | +//- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag | |
| 25 | +//{ | |
| 26 | +// NSLog(@"fighter stop:%@",self); | |
| 27 | +// self.completion(); | |
| 28 | +//// [[NSNotificationCenter defaultCenter] postNotificationName:NSNotificationAnimationDidStop object:nil]; | |
| 29 | +//} | |
| 23 | 30 | |
| 24 | 31 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
| ... | ... | @@ -83,8 +83,6 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 83 | 83 | [[LVCAnimationManager shareManager] bubblingWithCenterPoint:CGPointMake(SCREEN_WIDTH - 50, SCREEN_HEIGHT - 50) toView:self.animationBaseView speed:1]; |
| 84 | 84 | |
| 85 | 85 | [self.animationBaseView addSubview:self.chatTableView]; |
| 86 | - self.chatTableView.backgroundColor = [UIColor whiteColor]; | |
| 87 | - self.chatTableView.alpha = 0.7; | |
| 88 | 86 | |
| 89 | 87 | [self.animationBaseView addSubview:self.topToolsView]; |
| 90 | 88 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; |
| ... | ... | @@ -154,8 +152,8 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 154 | 152 | [bgView addSubview:sendBtn]; |
| 155 | 153 | |
| 156 | 154 | _commentText = [[UITextField alloc] initWithFrame:CGRectMake(_barrageSwitch.right + 20, 5, _commentsView.width - _barrageSwitch.right - 20 - 100, _commentsView.height - 10)]; |
| 157 | - _commentText.layer.borderColor = [UIColor blueColor].CGColor; | |
| 158 | - _commentText.layer.borderWidth = 1.0; | |
| 155 | +// _commentText.layer.borderColor = [UIColor blueColor].CGColor; | |
| 156 | +// _commentText.layer.borderWidth = 1.0; | |
| 159 | 157 | _commentText.layer.cornerRadius = 2.0; |
| 160 | 158 | _commentText.layer.masksToBounds = YES; |
| 161 | 159 | _commentText.inputAccessoryView = _commentsView; |
| ... | ... | @@ -644,9 +642,9 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 644 | 642 | if (!_barrageSwitch) |
| 645 | 643 | { |
| 646 | 644 | _barrageSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(10, 10, 40, 30)]; |
| 647 | - _barrageSwitch.tintColor = [UIColor orangeColor]; | |
| 648 | - _barrageSwitch.onTintColor = [UIColor orangeColor]; | |
| 649 | - _barrageSwitch.thumbTintColor = [UIColor lightGrayColor]; | |
| 645 | + _barrageSwitch.tintColor = [UIColor greenColor]; | |
| 646 | + _barrageSwitch.onTintColor = [UIColor greenColor]; | |
| 647 | + _barrageSwitch.thumbTintColor = [UIColor whiteColor]; | |
| 650 | 648 | _barrageSwitch.centerY = _commentsView.height * 0.5; |
| 651 | 649 | [_barrageSwitch addTarget:self action:@selector(barrageSiwthChange:) forControlEvents:UIControlEventValueChanged]; |
| 652 | 650 | } |
| ... | ... | @@ -659,8 +657,6 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 659 | 657 | { |
| 660 | 658 | _bottomToolView = [[BottomToolView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - BottomToolHeight, SCREEN_WIDTH, BottomToolHeight)]; |
| 661 | 659 | _bottomToolView.delegate = self; |
| 662 | - _bottomToolView.backgroundColor = [UIColor lightGrayColor]; | |
| 663 | - _bottomToolView.alpha = 0.7; | |
| 664 | 660 | } |
| 665 | 661 | return _bottomToolView; |
| 666 | 662 | } |
| ... | ... | @@ -685,6 +681,14 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 685 | 681 | tableView.showsHorizontalScrollIndicator = NO; |
| 686 | 682 | tableView.bounces = NO; |
| 687 | 683 | tableView.backgroundColor = [UIColor clearColor]; |
| 684 | + | |
| 685 | +// UIView *view = [[UIView alloc] initWithFrame:tableView.bounds]; | |
| 686 | +// [tableView addSubview:view]; | |
| 687 | +// | |
| 688 | +// UIImageView *bgView = [[UIImageView alloc] initWithFrame:view.bounds]; | |
| 689 | +// bgView.image = [UIImage imageNamed:@"背景400x300"]; | |
| 690 | +// [view addSubview:bgView]; | |
| 691 | +// tableView.backgroundView = view; | |
| 688 | 692 | _chatTableView = tableView; |
| 689 | 693 | } |
| 690 | 694 | return _chatTableView; | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/PrivateView/PrivateView.m
| ... | ... | @@ -184,6 +184,7 @@ static NSString *message_content = @"message_content"; |
| 184 | 184 | { |
| 185 | 185 | _nameLbl = [[UILabel alloc] initWithFrame:CGRectMake(100, 5, self.width - 100, 30)]; |
| 186 | 186 | _nameLbl.centerX = self.width * 0.5; |
| 187 | + _nameLbl.centerY = self.closeBtn.centerY; | |
| 187 | 188 | _nameLbl.text = @"哈哈哈主播的名字"; |
| 188 | 189 | [_nameLbl setTextColor:[UIColor cyanColor]]; |
| 189 | 190 | _nameLbl.numberOfLines = 1; |
| ... | ... | @@ -220,7 +221,7 @@ static NSString *message_content = @"message_content"; |
| 220 | 221 | _tableView.showsHorizontalScrollIndicator = NO; |
| 221 | 222 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
| 222 | 223 | _tableView.bounces = NO; |
| 223 | - _tableView.backgroundColor = [UIColor clearColor]; | |
| 224 | + _tableView.backgroundColor = [UIColor colorWithRed:0.96 green:0.98 blue:0.98 alpha:1.00]; | |
| 224 | 225 | } |
| 225 | 226 | return _tableView; |
| 226 | 227 | } | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/TopToolView/TopToolView.m
| ... | ... | @@ -75,7 +75,7 @@ |
| 75 | 75 | if (!_bgView) |
| 76 | 76 | { |
| 77 | 77 | _bgView = [[UIImageView alloc] initWithFrame:self.bounds]; |
| 78 | - _bgView.backgroundColor = ZXRandomColor; | |
| 78 | + _bgView.image = [UIImage imageNamed:@"背景200x50"]; | |
| 79 | 79 | _bgView.layer.masksToBounds = YES; |
| 80 | 80 | _bgView.layer.cornerRadius = _bgView.height * 0.5; |
| 81 | 81 | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/22.imageset/22.png
0 → 100644
15.8 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/22.imageset/Contents.json
0 → 100644
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat.png.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/Gift/背景400x60.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/Gift/背景400x60.imageset/背景400x60.png
0 → 100644
1.73 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/priToolBg.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat.png.imageset/privateChat.png deleted
100644 → 0
6.61 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat11.imageset/Contents.json
0 → 100644
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat11.imageset/privateChat11.png
0 → 100644
14.7 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat3.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "privateChat3.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/privateChat3.imageset/privateChat3.png
0 → 100644
20.3 KB