Commit 10a9645e by suolong

提交bug

parent bf1e61e0
...@@ -691,7 +691,7 @@ ...@@ -691,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260061; CURRENT_PROJECT_VERSION = 202506260064;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
...@@ -956,7 +956,7 @@ ...@@ -956,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260061; CURRENT_PROJECT_VERSION = 202506260064;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
......
...@@ -3912,28 +3912,35 @@ BDAlphaPlayerMetalViewDelegate ...@@ -3912,28 +3912,35 @@ BDAlphaPlayerMetalViewDelegate
CGFloat padding = 8.0; CGFloat padding = 8.0;
CGFloat contentLeftInset = 14.0; CGFloat contentLeftInset = 14.0;
CGFloat giftIconSize = 18.0; CGFloat giftIconSize = 18.0;
CGFloat countW = 28.0; CGFloat maxCountWidth = 0.0;
CGFloat labelX = padding + giftIconSize + 4.0 + countW + 8.0; CGFloat textGap = 3.0;
CGFloat maxLabelWidth = 0.0; CGFloat maxLabelWidth = 0.0;
UIFont *labelFont = [UIFont fus_themeFont:12]; UIFont *labelFont = [UIFont fus_themeFont:12];
UIFont *countFont = [UIFont fus_themeFont:11];
for (FUSLiveGiftInteractSettingItemModel *model in self.giftInteractAudienceVisibleList) { for (FUSLiveGiftInteractSettingItemModel *model in self.giftInteractAudienceVisibleList) {
NSString *text = model.name ?: @""; NSString *text = model.name ?: @"";
if (text.length == 0) {
continue;
}
CGSize size = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, ceil(labelFont.lineHeight)) CGSize size = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, ceil(labelFont.lineHeight))
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName: labelFont} attributes:@{NSFontAttributeName: labelFont}
context:nil].size; context:nil].size;
maxLabelWidth = MAX(maxLabelWidth, ceil(size.width)); maxLabelWidth = MAX(maxLabelWidth, ceil(size.width));
NSString *countText = (model.giftNum > 0 ? [NSString stringWithFormat:@"x%ld", (long)model.giftNum] : @"");
CGSize countSize = [countText boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, ceil(countFont.lineHeight))
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName: countFont}
context:nil].size;
maxCountWidth = MAX(maxCountWidth, ceil(countSize.width));
} }
CGFloat labelX = padding + giftIconSize + 4.0 + maxCountWidth + textGap;
CGFloat internalContentWidth = padding + labelX + maxLabelWidth; CGFloat internalContentWidth = padding + labelX + maxLabelWidth;
CGFloat computedWidth = contentLeftInset + internalContentWidth; CGFloat computedWidth = contentLeftInset + internalContentWidth;
CGFloat maxAllowedWidth = MAX(0.0, containerWidth - rightMargin);
CGFloat width = MIN(MAX(minWidth, computedWidth), maxAllowedWidth);
NSInteger count = MIN(6, self.giftInteractAudienceVisibleList.count); NSInteger count = MIN(6, self.giftInteractAudienceVisibleList.count);
CGFloat maxAllowedWidth = MAX(0.0, containerWidth - rightMargin);
CGFloat targetWidth = (count > 0 ? computedWidth : MAX(minWidth, computedWidth));
CGFloat width = MIN(targetWidth, maxAllowedWidth);
CGFloat height = 0; CGFloat height = 0;
CGFloat headerH = 35; CGFloat headerH = 35;
CGFloat rowHeight = 26; CGFloat rowHeight = 26;
......
...@@ -155,7 +155,7 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0; ...@@ -155,7 +155,7 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0;
UIImage *placeholder = [FUSShowRoomCenterBunble imageNamed:@"icon_gift_placehold"]; UIImage *placeholder = [FUSShowRoomCenterBunble imageNamed:@"icon_gift_placehold"];
for (NSInteger i = 0; i < targetCount; i++) { for (NSInteger i = 0; i < targetCount; i++) {
FUSLiveGiftInteractSettingItemModel *model = self.items[i]; FUSLiveGiftInteractSettingItemModel *model = self.items[i];
NSString *text = model.name; NSString *text = [NSString stringAddFromNilWith:model.name];
UILabel *textLabel = self.textLabels[i]; UILabel *textLabel = self.textLabels[i];
textLabel.text = text ?: @""; textLabel.text = text ?: @"";
...@@ -217,14 +217,34 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0; ...@@ -217,14 +217,34 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0;
self.emptyLabel.frame = CGRectZero; self.emptyLabel.frame = CGRectZero;
CGFloat giftIconSize = 18; CGFloat giftIconSize = 18;
CGFloat countW = 28;
CGFloat giftIconX = padding; CGFloat giftIconX = padding;
CGFloat giftCountX = giftIconX + giftIconSize + 4; CGFloat giftCountX = giftIconX + giftIconSize + 4;
CGFloat labelX = giftCountX + countW + 8; CGFloat textGap = 3;
CGFloat labelW = contentW - padding - labelX; CGFloat maxLabelWidth = 0;
if (labelW < 0) { CGFloat maxCountWidth = 0;
labelW = 0; UIFont *labelFont = [UIFont fus_themeFont:12];
UIFont *countFont = [UIFont fus_themeFont:11];
for (FUSLiveGiftInteractSettingItemModel *model in self.items) {
NSString *text = [NSString stringAddFromNilWith:model.name];
if (text.length == 0) {
text = @"";
}
CGSize size = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, ceil(labelFont.lineHeight))
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName: labelFont}
context:nil].size;
maxLabelWidth = MAX(maxLabelWidth, ceil(size.width));
NSString *countText = (model.giftNum > 0 ? [NSString stringWithFormat:@"x%ld", (long)model.giftNum] : @"");
CGSize countSize = [countText boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, ceil(countFont.lineHeight))
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName: countFont}
context:nil].size;
maxCountWidth = MAX(maxCountWidth, ceil(countSize.width));
} }
CGFloat labelX = giftCountX + maxCountWidth + textGap;
CGFloat availableLabelW = MAX(0, contentW - padding - labelX);
CGFloat labelW = MIN(availableLabelW, maxLabelWidth);
CGFloat availableH = CGRectGetHeight(self.bounds) - contentTop - padding * 2; CGFloat availableH = CGRectGetHeight(self.bounds) - contentTop - padding * 2;
CGFloat rowHeight = (availableH > 0 ? (availableH / self.items.count) : 0); CGFloat rowHeight = (availableH > 0 ? (availableH / self.items.count) : 0);
...@@ -237,7 +257,7 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0; ...@@ -237,7 +257,7 @@ static CGFloat const kFUSGiftInteractAudiencePanelLeftInset = 14.0;
iconView.frame = CGRectMake(contentX + giftIconX, y + (rowHeight - giftIconSize) * 0.5, giftIconSize, giftIconSize); iconView.frame = CGRectMake(contentX + giftIconX, y + (rowHeight - giftIconSize) * 0.5, giftIconSize, giftIconSize);
CBAutoScrollLabel *countLabel = self.giftCountLabels[i]; CBAutoScrollLabel *countLabel = self.giftCountLabels[i];
countLabel.frame = CGRectMake(contentX + giftCountX, y, countW, rowHeight); countLabel.frame = CGRectMake(contentX + giftCountX, y, maxCountWidth, rowHeight);
UIButton *btn = self.itemButtons[i]; UIButton *btn = self.itemButtons[i];
btn.frame = CGRectMake(contentX, y, contentW, rowHeight); btn.frame = CGRectMake(contentX, y, contentW, rowHeight);
......
...@@ -126,7 +126,7 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0; ...@@ -126,7 +126,7 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0;
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
self.blurView = [[UIVisualEffectView alloc] initWithEffect:effect]; self.blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
self.blurView.frame = self.contentView.bounds; self.blurView.frame = self.contentView.bounds;
self.blurView.alpha = 0.2; self.blurView.alpha = 0.3;
[self.contentView addSubview:self.blurView]; [self.contentView addSubview:self.blurView];
self.arrowBtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.arrowBtn = [UIButton buttonWithType:UIButtonTypeCustom];
...@@ -196,7 +196,7 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0; ...@@ -196,7 +196,7 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0;
CGFloat priceX = self.diamondIconView.right + 2; CGFloat priceX = self.diamondIconView.right + 2;
CGFloat priceW = MAX(0, self.contentView.width - contentPadding - priceX); CGFloat priceW = MAX(0, self.contentView.width - contentPadding - priceX);
self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(priceX, y - 1, priceW, 12)]; self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(priceX, y - 1, priceW, 12)];
self.priceLabel.font = [UIFont boldSystemFontOfSize:8]; self.priceLabel.font = [UIFont boldSystemFontOfSize:10];
self.priceLabel.textColor = [UIColor fus_diamondBlue]; self.priceLabel.textColor = [UIColor fus_diamondBlue];
self.priceLabel.text = @"0/分钟"; self.priceLabel.text = @"0/分钟";
[self.contentView addSubview:self.priceLabel]; [self.contentView addSubview:self.priceLabel];
...@@ -267,9 +267,9 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0; ...@@ -267,9 +267,9 @@ static CGFloat const kFUSPayRoomCompanionMinWidth = 120.0;
} }
NSInteger unitPrice = MAX(0, companionData.payUnitPrice); NSInteger unitPrice = MAX(0, companionData.payUnitPrice);
NSString *priceText = [NSString stringWithFormat:@"%ld /%@", (long)unitPrice,[NSString fus_localString:@"分钟"]]; NSString *priceText = [NSString stringWithFormat:@"%ld / %@", (long)unitPrice,[NSString fus_localString:@"分钟"]];
NSMutableAttributedString *priceAttr = [[NSMutableAttributedString alloc] initWithString:priceText attributes:@{ NSMutableAttributedString *priceAttr = [[NSMutableAttributedString alloc] initWithString:priceText attributes:@{
NSFontAttributeName: self.priceLabel.font ?: [UIFont boldSystemFontOfSize:8], NSFontAttributeName: self.priceLabel.font ?: [UIFont boldSystemFontOfSize:10],
NSForegroundColorAttributeName: [UIColor colorWithWhite:1 alpha:0.9] NSForegroundColorAttributeName: [UIColor colorWithWhite:1 alpha:0.9]
}]; }];
NSRange slashRange = [priceText rangeOfString:@"/"]; NSRange slashRange = [priceText rangeOfString:@"/"];
......
...@@ -377,24 +377,25 @@ static NSInteger const kFUSPayRoomEntryMainViewTag = 90917003; ...@@ -377,24 +377,25 @@ static NSInteger const kFUSPayRoomEntryMainViewTag = 90917003;
NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = jewelIcon; attachment.image = jewelIcon;
attachment.bounds = CGRectMake(0, -2, 12, 12); attachment.bounds = CGRectMake(0, -4, 16, 16);
NSMutableAttributedString *textAttr = [[NSMutableAttributedString alloc] initWithString:safeText attributes:@{ NSString *displayText = [safeText stringByReplacingOccurrencesOfString:@"/分钟" withString:@" / 分钟"];
NSMutableAttributedString *textAttr = [[NSMutableAttributedString alloc] initWithString:displayText attributes:@{
NSFontAttributeName: self.bottomTipLabel.font, NSFontAttributeName: self.bottomTipLabel.font,
NSForegroundColorAttributeName: normalTextColor NSForegroundColorAttributeName: normalTextColor
}]; }];
NSRange commaRange = [safeText rangeOfString:@"," options:NSBackwardsSearch]; NSRange commaRange = [displayText rangeOfString:@"," options:NSBackwardsSearch];
if (commaRange.location == NSNotFound) { if (commaRange.location == NSNotFound) {
commaRange = [safeText rangeOfString:@"," options:NSBackwardsSearch]; commaRange = [displayText rangeOfString:@"," options:NSBackwardsSearch];
} }
NSRange digitRange = NSMakeRange(NSNotFound, 0); NSRange digitRange = NSMakeRange(NSNotFound, 0);
if (commaRange.location != NSNotFound && NSMaxRange(commaRange) < safeText.length) { if (commaRange.location != NSNotFound && NSMaxRange(commaRange) < displayText.length) {
NSRange suffixRange = NSMakeRange(NSMaxRange(commaRange), safeText.length - NSMaxRange(commaRange)); NSRange suffixRange = NSMakeRange(NSMaxRange(commaRange), displayText.length - NSMaxRange(commaRange));
NSError *suffixRegexError = nil; NSError *suffixRegexError = nil;
NSRegularExpression *suffixRegex = [NSRegularExpression regularExpressionWithPattern:@"(\\d+)" options:0 error:&suffixRegexError]; NSRegularExpression *suffixRegex = [NSRegularExpression regularExpressionWithPattern:@"(\\d+)" options:0 error:&suffixRegexError];
NSTextCheckingResult *suffixMatch = (suffixRegexError ? nil : [suffixRegex firstMatchInString:safeText options:0 range:suffixRange]); NSTextCheckingResult *suffixMatch = (suffixRegexError ? nil : [suffixRegex firstMatchInString:displayText options:0 range:suffixRange]);
if (suffixMatch && suffixMatch.numberOfRanges > 1) { if (suffixMatch && suffixMatch.numberOfRanges > 1) {
digitRange = [suffixMatch rangeAtIndex:1]; digitRange = [suffixMatch rangeAtIndex:1];
} }
...@@ -403,14 +404,14 @@ static NSInteger const kFUSPayRoomEntryMainViewTag = 90917003; ...@@ -403,14 +404,14 @@ static NSInteger const kFUSPayRoomEntryMainViewTag = 90917003;
if (digitRange.location == NSNotFound) { if (digitRange.location == NSNotFound) {
NSError *fallbackRegexError = nil; NSError *fallbackRegexError = nil;
NSRegularExpression *fallbackRegex = [NSRegularExpression regularExpressionWithPattern:@"(\\d+)\\s*/" options:0 error:&fallbackRegexError]; NSRegularExpression *fallbackRegex = [NSRegularExpression regularExpressionWithPattern:@"(\\d+)\\s*/" options:0 error:&fallbackRegexError];
NSArray<NSTextCheckingResult *> *matches = (fallbackRegexError ? @[] : [fallbackRegex matchesInString:safeText options:0 range:NSMakeRange(0, safeText.length)]); NSArray<NSTextCheckingResult *> *matches = (fallbackRegexError ? @[] : [fallbackRegex matchesInString:displayText options:0 range:NSMakeRange(0, displayText.length)]);
NSTextCheckingResult *lastMatch = matches.lastObject; NSTextCheckingResult *lastMatch = matches.lastObject;
if (lastMatch && lastMatch.numberOfRanges > 1) { if (lastMatch && lastMatch.numberOfRanges > 1) {
digitRange = [lastMatch rangeAtIndex:1]; digitRange = [lastMatch rangeAtIndex:1];
} }
} }
if (digitRange.location != NSNotFound && NSMaxRange(digitRange) <= safeText.length) { if (digitRange.location != NSNotFound && NSMaxRange(digitRange) <= displayText.length) {
NSAttributedString *attachmentAttr = [NSAttributedString attributedStringWithAttachment:attachment]; NSAttributedString *attachmentAttr = [NSAttributedString attributedStringWithAttachment:attachment];
NSAttributedString *spaceAttr = [[NSAttributedString alloc] initWithString:@"\u2009" attributes:@{ NSAttributedString *spaceAttr = [[NSAttributedString alloc] initWithString:@"\u2009" attributes:@{
NSFontAttributeName: self.bottomTipLabel.font, NSFontAttributeName: self.bottomTipLabel.font,
......
...@@ -129,7 +129,7 @@ static CGFloat const kFUSAnchorPayRoomStatsHorizontalPadding = 9.0; ...@@ -129,7 +129,7 @@ static CGFloat const kFUSAnchorPayRoomStatsHorizontalPadding = 9.0;
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
self.blurView = [[UIVisualEffectView alloc] initWithEffect:effect]; self.blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
self.blurView.frame = self.contentView.bounds; self.blurView.frame = self.contentView.bounds;
self.blurView.alpha = 0.2; self.blurView.alpha = 0.3;
[self.contentView addSubview:self.blurView]; [self.contentView addSubview:self.blurView];
self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.width, 33)]; self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.width, 33)];
......
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