开通贵族公屏消息,贵族升级飘屏

This commit is contained in:
chenguilong
2022-01-10 19:59:58 +08:00
committed by fengshuo
parent 004f3f9c5c
commit 1ccc5fcad7
10 changed files with 249 additions and 5 deletions

View File

@@ -34,6 +34,7 @@
#import "XPRoomGiftBroadcastView.h"
#import "XPRoomCandyGiftView.h"
#import "XPRoomDatingAnimationView.h"
#import "XPRoomNobleLevelUpView.h"
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate>
@@ -77,6 +78,8 @@
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
///
@property (nonatomic,strong) NSMutableArray *candyTreegiftQueue;
///
@property (nonatomic, strong) NSMutableArray *nobleLevelUpQueue;
#pragma mark -
@property (nonatomic, strong) NSMutableArray<NSString *> *carEffectQueue;
@property (nonatomic,strong) SVGAImageView *carEffectView;
@@ -162,7 +165,9 @@
[self receiveDriveCarEnterRoom:attachment];
} else if(attachment.first == CustomMessageType_RoomPlay_Dating && attachment.second == Custom_Message_Sub_Room_Play_Dating_Public_Result) {
[self roomDatingPublicResult:attachment];
}
} else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Noble_LevelUp_Suspend) { ///
[self receiveNobleLevelUp:attachment];
}
}
}
@@ -370,6 +375,49 @@
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
}
#pragma mark -
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
if (self.nobleLevelUpQueue.count == 0) {
[self createNobleLevelUpBannerAnimation:attachment.data];
}
[self.nobleLevelUpQueue addObject:attachment.data];
}
- (void)createNobleLevelUpBannerAnimation:(NSDictionary *)dic {
XPRoomNobleLevelUpView *nobleLevelUpView = [[XPRoomNobleLevelUpView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 90)];
nobleLevelUpView.nobleInfo = dic;
[self.middleLevelView addSubview:nobleLevelUpView];
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
springAnimation.springSpeed = 12;
springAnimation.springBounciness = 10.f;
springAnimation.fromValue = [NSValue valueWithCGPoint:nobleLevelUpView.center];
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(nobleLevelUpView.frame.size.width / 2, nobleLevelUpView.center.y)];
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, nobleLevelUpView.center.y)];
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, nobleLevelUpView.center.y)];
moveAnimation.beginTime = CACurrentMediaTime() + 3;
moveAnimation.duration = 0.5;
moveAnimation.repeatCount = 1;
moveAnimation.removedOnCompletion = YES;
@kWeakify(self);
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
@kStrongify(self);
if (finished) {
[nobleLevelUpView removeFromSuperview];
[self.nobleLevelUpQueue removeObjectAtIndex:0];
if (self.nobleLevelUpQueue.count > 0) {
[self createNobleLevelUpBannerAnimation:self.nobleLevelUpQueue.firstObject];
}
}
}];
[nobleLevelUpView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
}
}];
[nobleLevelUpView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
}
#pragma mark -
- (void)receiveGiftHandleSendGiftAnimation:(AttachmentModel *)attachment {
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
@@ -1051,6 +1099,13 @@
return _candyTreegiftQueue;
}
- (NSMutableArray *)nobleLevelUpQueue {
if (!_nobleLevelUpQueue) {
_nobleLevelUpQueue = [NSMutableArray array];
}
return _nobleLevelUpQueue;
}
- (NSMutableArray<NSString *> *)carEffectQueue {
if (_carEffectQueue == nil) {
_carEffectQueue = [NSMutableArray array];