Commit 9c5a47f5 by suolong

添加下动画

parent 6875e871
......@@ -63,6 +63,7 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
@property (nonatomic, strong) UILabel *showTimeNewTicketLabel;
/// 记录最近一次新票数,用于无新票推送时保持展示
@property (nonatomic, assign) NSInteger lastNewTicketCount;
@property (nonatomic, copy) NSString *lastGiftUserUid;
/// 分割线以下内容容器(用于垂直居中进度圈)
@property (nonatomic, strong) UIView *bottomContentView;
......@@ -523,6 +524,9 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
BOOL hasGiftUser = (giftUserModel != nil);
self.topTicketInfoContainerView.hidden = !hasGiftUser;
if (!hasGiftUser) {
[self.topTicketInfoContainerView.layer removeAllAnimations];
self.topTicketInfoContainerView.alpha = 1;
self.topTicketInfoContainerView.transform = CGAffineTransformIdentity;
self.topTitleLabel.text = [NSString fus_localString:@""];
self.levLabel.text = @"0";
self.vipIconView.image = nil;
......@@ -533,9 +537,13 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
self.lastNewTicketCount = 0;
self.ticketIconView.hidden = YES;
self.showTimeNewTicketLabel.hidden = YES;
self.lastGiftUserUid = @"";
return;
}
NSString *candidateUid = (giftUserModel.realUid.length > 0 ? giftUserModel.realUid : giftUserModel.uid);
BOOL isNewGiftUser = (candidateUid.length > 0 ? ![self.lastGiftUserUid isEqualToString:candidateUid] : NO);
NSString *nickname = (giftUserModel.nickname.length > 0 ? giftUserModel.nickname : giftUserModel.uid);
NSString *decodedNickname = (nickname.length > 0 ? (nickname.stringByRemovingPercentEncoding ?: nickname) : @"");
self.topTitleLabel.text = (decodedNickname.length > 0 ? decodedNickname : [NSString fus_localString:@""]);
......@@ -577,6 +585,26 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
self.ticketIconView.hidden = NO;
self.showTimeNewTicketLabel.hidden = NO;
self.showTimeNewTicketLabel.text = [NSString stringWithFormat:@"+%zd", (NSInteger)MAX(0, self.lastNewTicketCount)];
if (isNewGiftUser) {
[self fus_playTopTicketInfoContainerEnterAnimation];
} else {
[self.topTicketInfoContainerView.layer removeAllAnimations];
self.topTicketInfoContainerView.alpha = 1;
self.topTicketInfoContainerView.transform = CGAffineTransformIdentity;
}
self.lastGiftUserUid = (candidateUid ?: @"");
}
/// 新用户到来时,顶部上票信息从右侧滑入并渐显
- (void)fus_playTopTicketInfoContainerEnterAnimation {
[self.topTicketInfoContainerView.layer removeAllAnimations];
self.topTicketInfoContainerView.alpha = 0;
self.topTicketInfoContainerView.transform = CGAffineTransformMakeTranslation(24, 0);
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
self.topTicketInfoContainerView.alpha = 1;
self.topTicketInfoContainerView.transform = CGAffineTransformIdentity;
} completion:nil];
}
- (void)fus_updateAudienceWithState:(FUSLiveShowTimeCollectFrostedState)state
......@@ -796,8 +824,6 @@ static const NSInteger kFUSShowTimeCollectSeconds = 60 * 10;
}
- (void)fus_applyBottomInfoLayout {
// 功能:统一主播/观众底部信息排版,仅保留按钮显隐差异
BOOL isPerformance = NO;
self.performanceCountdownTitleLabel.hidden = YES;
self.themeLabel.hidden = NO;
self.performanceCountdownTitleLabel.text = @"";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment