app年龄,星座,寻爱飘屏优化

This commit is contained in:
liyuhua
2023-09-20 17:34:12 +08:00
parent ccc29db030
commit 2435a11e85
75 changed files with 1367 additions and 663 deletions

View File

@@ -12,6 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomAnimationView : XPRoomAnimationHitView <RoomGuestDelegate>
-(void)resumeTimer;
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
@end

View File

@@ -15,6 +15,7 @@
#import "UIView+VAP.h"
#import <YYText/YYText.h>
#import <UIImageView+WebCache.h>
#import <libpag/libpag-umbrella.h>
///Tool
#import "XPGiftStorage.h"
#import "YUMIMacroUitls.h"
@@ -77,6 +78,8 @@
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
///
@property (nonatomic,strong) SVGAImageView *giftEffectView;
///pag
@property(nonatomic,strong) PAGView *giftPagView;
///VAP
@property (nonatomic, strong) VAPView *vapGiftEffectView;
///
@@ -164,7 +167,17 @@
self.giftTimer = nil;
}
}
-(void)resumeTimer{
if(self.giftEffectTimer != nil){
dispatch_resume(self.giftEffectTimer);
self.giftEffectTimer = nil;
}
if(self.giftTimer != nil){
dispatch_resume(self.giftTimer);
self.giftTimer = nil;
}
}
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
self = [super init];
if (self) {
@@ -2593,5 +2606,11 @@
}
return _svgaQueue;
}
- (PAGView *)giftPagView{
if(!_giftPagView){
_giftPagView = [[PAGView alloc]init];
}
return _giftPagView;
}
@end

View File

@@ -54,7 +54,10 @@
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.backImageView);
make.top.bottom.equalTo(self.backImageView);
make.leading.mas_equalTo(kGetScaleWidth(84));
make.trailing.mas_equalTo(-kGetScaleWidth(70.5));
}];
}
@@ -74,35 +77,36 @@
if(giftInfo.nick.length > 5){
giftInfo.nick = [NSString stringWithFormat:@"%@...",[giftInfo.nick substringToIndex:5]];
}
CGFloat fontSize = self.isMaxLargeGift ? 20 : 12;
CGFloat fontSize = self.isMaxLargeGift ? 12 : 12;
[attribute appendAttributedString:[self createAttribute:YMLocalizedString(@"XPRoomCandyGiftView0") color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.nick color:UIColorFromRGB(0xFEF23E) fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.nick color:UIColorFromRGB(0xFFE44E) fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:YMLocalizedString(@"XPRoomCandyGiftView1") color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.prizeName color:UIColorFromRGB(0x00EAFF) fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:giftInfo.prizeName color:UIColorFromRGB(0xFFE44E) fontSize:fontSize]];
if (giftInfo.prizeNum > 1) {
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:UIColorFromRGB(0x00EAFF) fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", giftInfo.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
}
self.titleLabel.attributedText = attribute;
self.titleLabel.textAlignment = NSTextAlignmentCenter;
if (self.isMaxLargeGift) {
self.backImageView.hidden = YES;
self.candyTreeView.hidden = NO;
@kWeakify(self);
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/candyTree_banner.svga", API_Image_URL];
[self.parser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
[self.parser parseWithNamed:@"pi_room_game_fine_love" inBundle:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
self.candyTreeView.loops = 1;
self.candyTreeView.loops = 2;
self.candyTreeView.clearsAfterStop = NO;
self.candyTreeView.videoItem = videoItem;
[self.candyTreeView setAttributedText:attribute forKey:@"noble_text_tx"];
[self.candyTreeView startAnimation];
} failureBlock:^(NSError * _Nonnull error) {
} failureBlock:^(NSError * _Nonnull error) {
}];
} else {
self.backImageView.hidden = NO;
self.candyTreeView.hidden = YES;
self.titleLabel.attributedText = attribute;
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
}
}
@@ -136,6 +140,7 @@
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.numberOfLines = 2;
}
return _titleLabel;
}