飘屏优化
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
#import "PIFullScreenBannerAnimation.h"
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
#import "XPTreasureFairyGiftView.h"
|
||||
#import "XPRoomTarrowBannerView.h"
|
||||
@interface PIFullScreenBannerAnimation()<XPRoomGiftBroadcastViewDelegate,XPRoomLuckyBigPrizeViewDelegate,XPRoomLicneseHourRankViewDelegate, XPRoomStarKitchenBannerViewDelegate>
|
||||
///礼物飘屏 PresentAchieveAbstractMatrix
|
||||
@property(nonatomic,strong) NSMutableArray<GiftReceiveInfoModel *> *animationListA;
|
||||
@@ -179,6 +180,10 @@
|
||||
[self createLicneseHourRankAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Fairy){
|
||||
[self createTreasureFairyBannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Tarrow){
|
||||
[self createBigPrizeAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Common_H5){
|
||||
[self createCommonH5BannerAnimation:model];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,10 +211,131 @@
|
||||
[self createLicneseHourRankAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Fairy){
|
||||
[self createTreasureFairyBannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Tarrow){
|
||||
[self createBigPrizeAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Common_H5){
|
||||
[self createCommonH5BannerAnimation:model];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 收到h5通用飘屏
|
||||
-(void)receiveCommonH5Banner:(AttachmentModel *)attachment{
|
||||
|
||||
PIBaseAnimationViewModel *giftNotifyInfo = [PIBaseAnimationViewModel modelWithJSON:attachment.data];
|
||||
giftNotifyInfo.type = GiftBannerType_Common_H5;
|
||||
giftNotifyInfo.second = attachment.second;
|
||||
if (self.animationListB.count == 0 && self.isPlayOfB == NO) {
|
||||
[self createCommonH5BannerAnimation:giftNotifyInfo];
|
||||
}
|
||||
[self.animationListB addObject:giftNotifyInfo];
|
||||
}
|
||||
- (void)createCommonH5BannerAnimation:(PIBaseAnimationViewModel *)attatchment {
|
||||
|
||||
CGFloat kscale = (CGFloat)55 / (CGFloat)375;
|
||||
self.isPlayOfB = YES;
|
||||
CGFloat top = self.isPlayOfA == YES ? (190 + statusbarHeight) : (kNavigationHeight + 15);
|
||||
XPRoomTarrowBannerView *tarrowVeiw = [[XPRoomTarrowBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale)isH5:YES];
|
||||
tarrowVeiw.isBig = attatchment.second == Custom_Message_Sub_Common_H5_Advanced;
|
||||
tarrowVeiw.giftInfo = attatchment;
|
||||
[kWindow addSubview:tarrowVeiw];
|
||||
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:tarrowVeiw.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(tarrowVeiw.frame.size.width / 2, tarrowVeiw.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, tarrowVeiw.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2,tarrowVeiw.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) {
|
||||
[tarrowVeiw removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
// if(self. isAnimationListAFinish == YES){
|
||||
//
|
||||
// [self playAnimationWithModel];
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
}
|
||||
}];
|
||||
[tarrowVeiw pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[tarrowVeiw pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
|
||||
|
||||
}
|
||||
#pragma mark - 收到塔罗飘屏
|
||||
-(void)receiveTarotBanner:(AttachmentModel *)attachment{
|
||||
PIBaseAnimationViewModel *giftNotifyInfo = [PIBaseAnimationViewModel modelWithJSON:attachment.data];
|
||||
giftNotifyInfo.type = GiftBannerType_Tarrow;
|
||||
giftNotifyInfo.second = attachment.second;
|
||||
if (self.animationListB.count == 0 && self.isPlayOfB == NO) {
|
||||
[self createTarotBannerAnimation:giftNotifyInfo];
|
||||
}
|
||||
[self.animationListB addObject:giftNotifyInfo];
|
||||
}
|
||||
- (void)createTarotBannerAnimation:(PIBaseAnimationViewModel *)attatchment {
|
||||
|
||||
CGFloat kscale = (CGFloat)55 / (CGFloat)375;
|
||||
self.isPlayOfB = YES;
|
||||
CGFloat top = self.isPlayOfA == YES ? (190 + statusbarHeight) : (kNavigationHeight + 15);
|
||||
XPRoomTarrowBannerView *tarrowVeiw = [[XPRoomTarrowBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale) isH5:NO];
|
||||
tarrowVeiw.isBig = attatchment.second == Custom_Message_Sub_Tarot_Advanced;
|
||||
tarrowVeiw.giftInfo = attatchment;
|
||||
[kWindow addSubview:tarrowVeiw];
|
||||
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:tarrowVeiw.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(tarrowVeiw.frame.size.width / 2, tarrowVeiw.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, tarrowVeiw.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2,tarrowVeiw.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) {
|
||||
[tarrowVeiw removeFromSuperview];
|
||||
self.isPlayOfB = NO;
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
// if(self. isAnimationListAFinish == YES){
|
||||
//
|
||||
// [self playAnimationWithModel];
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
}
|
||||
}];
|
||||
[tarrowVeiw pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[tarrowVeiw pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
|
||||
|
||||
}
|
||||
#pragma mark - 夺宝精灵横幅
|
||||
- (void)receiveTreasureFairyGiftHighLevel:(AttachmentModel *)attatchment {
|
||||
PIBaseAnimationViewModel *giftModel = [PIBaseAnimationViewModel new];
|
||||
|
Reference in New Issue
Block a user