Compare commits

...

3 Commits

Author SHA1 Message Date
eggmanQQQ
f078f926e9 #761 #967
1. 修正 PK UI 问题
2. 完成礼物面板的修改
2024-06-19 15:52:36 +08:00
eggmanQQQ
16a17b82ff try fix bug and remove some error fetch image sources 2024-06-19 15:05:38 +08:00
eggmanQQQ
ca7051f34e #761
修复多语言布局问题
2024-06-19 00:00:11 +08:00
17 changed files with 210 additions and 184 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "room_gift_panel_arrow@2x.png",
"filename" : "gift_bag_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_gift_panel_arrow@3x.png",
"filename" : "gift_bag_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

View File

@@ -8,8 +8,6 @@
#import "UILabel+MSRTL.h"
#import "NSMutableAttributedString+MSRTL.h"
BOOL isMSRTLString(NSString *string) {
if ([string hasPrefix:@"\u202B"] || [string hasPrefix:@"\u202A"]) {
return YES;
@@ -45,10 +43,6 @@ NSString * MSRTLString(NSString *string) {
Method oldTextMethod1 = class_getInstanceMethod(self,@selector(setAttributedText:));
Method newTextMethod1 = class_getInstanceMethod(self, @selector(msrtl_setAttributedText:));
method_exchangeImplementations(oldTextMethod1, newTextMethod1);
}
-(void)msrtl_setAttributedText:(NSAttributedString *)attributedText{

View File

@@ -48,20 +48,14 @@
language = @"ar";
}
if ([language isEqualToString:@"ar"]) {
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
} else {
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
[NSBundle setLanguageText:language];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kSwitchLanguage" object:language];
[[NSNotificationCenter defaultCenter] postNotificationName:@"kSwitchLanguage" object:language];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5* NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter]postNotificationName:@"kChanecNavView" object:language];

View File

@@ -75,8 +75,8 @@
make.height.mas_equalTo(18);
}];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-22);
make.top.mas_equalTo(22);
make.trailing.mas_equalTo(-12);
make.top.mas_equalTo(12);
make.width.height.mas_equalTo(33);
}];
@@ -97,7 +97,7 @@
[self.redRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.redHeadImageView.mas_bottom).mas_offset(8);
make.left.mas_equalTo(self);
make.right.mas_equalTo(self.redHeadImageView.mas_right);
make.width.mas_equalTo(70);
make.height.mas_equalTo(14);
}];
[self.redValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -106,7 +106,6 @@
make.height.mas_equalTo(14);
}];
[self.blueHeadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(70);
make.trailing.mas_equalTo(-12.5);
@@ -114,9 +113,9 @@
}];
[self.blueRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.blueHeadImageView.mas_bottom).mas_offset(8);
make.right.mas_equalTo(self);
make.width.mas_equalTo(70);
make.height.mas_equalTo(14);
make.left.mas_equalTo(self.blueHeadImageView.mas_left);
make.right.mas_equalTo(self);
}];
[self.blueValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.blueRoomTitleLabel);

View File

@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface XPAcrossRoomPKPanelView : UIView
- (void)startInitUI;
///开启pk
- (void)openCountdownWithTime:(long)time;
///pk 信息

View File

@@ -29,6 +29,7 @@ static CGFloat MiniHeight = 130.5;
@interface XPAcrossRoomPKPanelView ()
///
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *backgroundImageView_small;
#pragma mark - view
///
@property (nonatomic, strong) UIButton *helpButton;
@@ -54,7 +55,7 @@ static CGFloat MiniHeight = 130.5;
///
@property (nonatomic, strong) NetImageView *blueAvatarImageView;
///
@property (nonatomic, strong) UIButton *onlookButton;
@property (nonatomic, strong) UIButton *onLookButton;
#pragma mark -
///PK
@property (nonatomic, strong) UIView *progressView;
@@ -95,7 +96,7 @@ static CGFloat MiniHeight = 130.5;
///
@property (strong, nonatomic) dispatch_source_t timer;
@property (nonatomic, strong) MASConstraint *centerXConstraint;
@property (nonatomic, assign) CGPoint centerCenter;
@end
@implementation XPAcrossRoomPKPanelView
@@ -107,28 +108,33 @@ static CGFloat MiniHeight = 130.5;
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
if (self = [super initWithFrame:CGRectMake(0, 0, kGetScaleWidth(310), kGetScaleWidth(MaxHeight))]) {
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(changeLocation:)];
// delaysTouchesBegantouchBegin,
// YES,touchesBegan ;
// NO,touchesBegan ;
pan.delaysTouchesBegan = YES;
[self addGestureRecognizer:pan];
[self initSubViews];
[self initSubViewConstraints];
for (id view in self.ruleTextView.subviews) {
if ([view isKindOfClass:[UITextView class]]){
UITextView *textView = view;
textView.textAlignment = NSTextAlignmentLeft;
break;
}
}
}
return self;
}
- (void)startInitUI {
if (self.backgroundImageView.superview) {
return;
}
[self initSubViews];
[self initSubViewConstraints];
for (id view in self.ruleTextView.subviews) {
if ([view isKindOfClass:[UITextView class]]){
UITextView *textView = view;
textView.textAlignment = NSTextAlignmentLeft;
break;
}
}
}
#pragma mark - Public Method
- (void)resetAcrossPKViewData {
if (self.timer) {
@@ -140,12 +146,8 @@ static CGFloat MiniHeight = 130.5;
#pragma mark - Private Method
- (void)setupBackground {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(310));
make.height.mas_equalTo(kGetScaleWidth(MaxHeight));
}];
[self addSubview:self.backgroundImageView];
[self addSubview:self.backgroundImageView_small];
UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pk_background_top"]];
topImageView.contentMode = UIViewContentModeScaleAspectFill;
@@ -155,6 +157,11 @@ static CGFloat MiniHeight = 130.5;
make.edges.equalTo(self);
}];
[self.backgroundImageView_small mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(MiniHeight));
}];
[topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.centerY.mas_equalTo(self.mas_top).offset(7);
@@ -245,7 +252,7 @@ static CGFloat MiniHeight = 130.5;
}];
[self.teamContainerView insertSubview:self.assistButton belowSubview:self.redAvatarImageView];
[self.teamContainerView insertSubview:self.onlookButton belowSubview:self.blueAvatarImageView];
[self.teamContainerView insertSubview:self.onLookButton belowSubview:self.blueAvatarImageView];
[self.assistButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.redAvatarImageView.mas_trailing).offset(-16);
make.bottom.mas_equalTo(self.progressView.mas_top);
@@ -253,7 +260,7 @@ static CGFloat MiniHeight = 130.5;
make.height.mas_equalTo(14);
}];
[self.onlookButton mas_makeConstraints:^(MASConstraintMaker *make) {
[self.onLookButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.blueAvatarImageView.mas_leading).offset(16);
make.bottom.mas_equalTo(self.progressView.mas_top);
make.width.mas_equalTo(70);
@@ -283,12 +290,12 @@ static CGFloat MiniHeight = 130.5;
}];
[self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.redAvatarImageView.mas_trailing);
make.left.mas_equalTo(self.progressView).offset(2);
make.bottom.mas_equalTo(self.redAvatarImageView);
}];
[self.blueCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.blueAvatarImageView.mas_left);
make.right.mas_equalTo(self.progressView).offset(-2);
make.bottom.mas_equalTo(self.blueAvatarImageView);
}];
@@ -361,7 +368,6 @@ static CGFloat MiniHeight = 130.5;
make.width.equalTo(self.ruleTextView.mas_width).offset(20).priorityLow();
make.height.equalTo(self.ruleTextView.mas_height).offset(20);
}];
}
- (void)initSubViews {
@@ -475,25 +481,23 @@ static CGFloat MiniHeight = 130.5;
#pragma mark - Event Response
- (void)foldButtonAction:(UIButton *)sender {
sender.selected = !sender.selected;
CGRect newFrame = self.frame;
if (sender.isSelected) {
self.userStackView.hidden = NO;
[self mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(MaxHeight));
}];
self.backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_bg"];
[UIView animateWithDuration:0.5 animations:^{
self.foldButton.transform = CGAffineTransformIdentity;
}];
self.backgroundImageView.hidden = NO;
self.backgroundImageView_small.hidden = YES;
newFrame.size.height = kGetScaleWidth(MaxHeight);
self.foldButton.transform = CGAffineTransformIdentity;
} else {
self.userStackView.hidden = YES;
self.backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_small_bg"];
[self mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(MiniHeight));
}];
[UIView animateWithDuration:0.5 animations:^{
self.foldButton.transform = CGAffineTransformMakeRotation(M_PI);
}];
self.backgroundImageView.hidden = YES;
self.backgroundImageView_small.hidden = NO;
newFrame.size.height = kGetScaleWidth(MiniHeight);
self.foldButton.transform = CGAffineTransformMakeRotation(M_PI);
}
self.frame = newFrame;
[self layoutIfNeeded];
}
- (void)helpButtonAction:(UIButton *)sender {
@@ -503,25 +507,29 @@ static CGFloat MiniHeight = 130.5;
- (void)tapRedAvatarRecognizer:(UITapGestureRecognizer *)ges {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
[self.delegate XPAcrossRoomPKPanelView:self showUserCard:self.pkPanelInfo.cUid];
[self.delegate XPAcrossRoomPKPanelView:self
showUserCard:self.pkPanelInfo.cUid];
}
}
- (void)tapBlueAvatarRecognizer:(UITapGestureRecognizer *)ges {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
[self.delegate XPAcrossRoomPKPanelView:self showUserCard:self.pkPanelInfo.aUid];
[self.delegate XPAcrossRoomPKPanelView:self
showUserCard:self.pkPanelInfo.aUid];
}
}
- (void)assistButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:sendGiftToUser:)]) {
[self.delegate XPAcrossRoomPKPanelView:self sendGiftToUser:self.pkPanelInfo.cUid];
[self.delegate XPAcrossRoomPKPanelView:self
sendGiftToUser:self.pkPanelInfo.cUid];
}
}
- (void)onlookButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:onLookRoomonLookRoom:)]) {
[self.delegate XPAcrossRoomPKPanelView:self onLookRoom:self.pkPanelInfo.aUid];
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:onLookRoom:)]) {
[self.delegate XPAcrossRoomPKPanelView:self
onLookRoom:self.pkPanelInfo.aUid];
}
}
@@ -539,12 +547,12 @@ static CGFloat MiniHeight = 130.5;
CGPoint panPoint = [p locationInView:appWindow];
if (p.state == UIGestureRecognizerStateBegan) {
self.alpha = 1;
// self.alpha = 1;
} else if(p.state == UIGestureRecognizerStateChanged) {
self.center = CGPointMake(panPoint.x, panPoint.y);
} else if(p.state == UIGestureRecognizerStateEnded
|| p.state == UIGestureRecognizerStateCancelled) {
self.alpha = 1;
// self.alpha = 1;
CGFloat touchWidth = self.frame.size.width;
CGFloat touchHeight = self.frame.size.height;
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
@@ -576,6 +584,7 @@ static CGFloat MiniHeight = 130.5;
}else {
newCenter = CGPointMake(panPoint.x, screenHeight - touchWidth / 3);
}
self.centerCenter = newCenter;
[UIView animateWithDuration:0.25 animations:^{
if ((newCenter.y + self.frame.size.height / 2) > (KScreenHeight - kSafeAreaBottomHeight - 44)) {
self.center = CGPointMake(newCenter.x, KScreenHeight - self.frame.size.height / 2 - kSafeAreaBottomHeight - 44);
@@ -703,11 +712,22 @@ static CGFloat MiniHeight = 130.5;
_backgroundImageView = [[UIImageView alloc] init];
_backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_bg"];
_backgroundImageView.userInteractionEnabled = YES;
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _backgroundImageView;
}
- (UIImageView *)backgroundImageView_small {
if (!_backgroundImageView_small) {
_backgroundImageView_small = [[UIImageView alloc] init];
_backgroundImageView_small.image = [UIImage imageNamed:@"room_across_pk_panel_small_bg"];
_backgroundImageView_small.userInteractionEnabled = YES;
_backgroundImageView_small.contentMode = UIViewContentModeScaleAspectFit;
_backgroundImageView_small.hidden = YES;
}
return _backgroundImageView_small;
}
- (UIButton *)helpButton {
if (!_helpButton) {
_helpButton = [[UIButton alloc] init];
@@ -889,16 +909,16 @@ static CGFloat MiniHeight = 130.5;
return _assistButton;
}
- (UIButton *)onlookButton {
if (!_onlookButton) {
_onlookButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_onlookButton setBackgroundImage:kImage(@"pk_name_bg_blue") forState:UIControlStateNormal];
[_onlookButton setTitle:YMLocalizedString(@"XPAcrossRoomPKPanelView3") forState:UIControlStateNormal];
_onlookButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
[_onlookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_onlookButton addTarget:self action:@selector(onlookButtonAction:) forControlEvents:UIControlEventTouchUpInside];
- (UIButton *)onLookButton {
if (!_onLookButton) {
_onLookButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_onLookButton setBackgroundImage:kImage(@"pk_name_bg_blue") forState:UIControlStateNormal];
[_onLookButton setTitle:YMLocalizedString(@"XPAcrossRoomPKPanelView3") forState:UIControlStateNormal];
_onLookButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
[_onLookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_onLookButton addTarget:self action:@selector(onlookButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _onlookButton;
return _onLookButton;
}
- (UIButton *)foldButton {

View File

@@ -253,7 +253,6 @@
///PK
- (BOOL)isRoomPKPlaying {
return [self.pkPanelView isRoomPKPlaying];
// return [self.roompkPanelView isRoomPKPlaying];
}
#pragma mark - Private Method
@@ -460,12 +459,14 @@
}
}
// MARK: -----
- (void)configRoomPKPanelView:(BOOL)isEnter {
- (void)configRoomPKPanelView:(BOOL)isEnter{
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
self.pkPanelView.roomInfo = roomInfo;
[self showPKPanel_];
if (self.pkPanelView.isPanelMinion == NO) {
[self showPKPanel_];
}
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
NSString * uid = [AccountInfoStorage instance].getUid;
@@ -643,10 +644,8 @@
if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.acrossPKPanelView.superview) {
[self addSubview:self.acrossPKPanelView];
[self.acrossPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self).offset(354 + kSafeAreaTopHeight);
}];
[self.acrossPKPanelView startInitUI];
self.acrossPKPanelView.center = self.center;
}
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
}
@@ -744,16 +743,16 @@
if (error == nil) {
NIMChatroomMember * member = [members firstObject];
if (member.type == NIMChatroomMemberTypeCreator || meIsSuperAdmin) {
XPAcrossRoomPKInviteResultView * inviteResutView = [[XPAcrossRoomPKInviteResultView alloc] init];
inviteResutView.is_XP_Accept = YES;
[self addSubview:inviteResutView];
[inviteResutView mas_makeConstraints:^(MASConstraintMaker *make) {
XPAcrossRoomPKInviteResultView * inviteResultView = [[XPAcrossRoomPKInviteResultView alloc] init];
inviteResultView.is_XP_Accept = YES;
[self addSubview:inviteResultView];
[inviteResultView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(114 + kSafeAreaTopHeight);
make.centerX.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(281, 42));
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 40, 42));
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[inviteResutView removeFromSuperview];
[inviteResultView removeFromSuperview];
});
}
}
@@ -793,10 +792,8 @@
self.acrossPKCountView = nil;
if (!self.acrossPKPanelView.superview) {
[self addSubview:self.acrossPKPanelView];
[self.acrossPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(354 + kSafeAreaTopHeight);
make.centerX.mas_equalTo(self);
}];
[self.acrossPKPanelView startInitUI];
self.acrossPKPanelView.center = self.center;
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){

View File

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@class MicroQueueModel, AttachmentModel, RoomInfoModel, RoomPKChooseUserModel;
@interface XPRoomPKPanelView : UIView
@property (nonatomic, strong) UIView *pkPanelContentView;
@property (nonatomic, strong) NSMutableDictionary<NSString *, MicroQueueModel *> *micQueue;
///房间信息
@property (nonatomic, strong) RoomInfoModel *roomInfo;
@@ -29,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isRoomPKPlaying;
- (BOOL)isPanelMinion;
///收到礼物
- (void)roomPKReceiveGift:(AttachmentModel *)attachment;

View File

@@ -53,7 +53,7 @@
///()
@property (nonatomic, strong) NSMutableDictionary * blueTeamGiftPersonDic;
@property (nonatomic, strong) UIView *pkPanelContentView;
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *topImageView;
@@ -88,6 +88,8 @@
@property (nonatomic, strong) UILabel *blueCountLabel;
@property (nonatomic, strong) UIImageView *fireImageView;
@property (nonatomic, assign) BOOL isMinion;
@end
@implementation XPRoomPKPanelView
@@ -106,7 +108,7 @@
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
// [self setupUI];
}
return self;
}
@@ -306,8 +308,9 @@
}
break;
case Custom_Message_Sub_Room_PK_Result:{
[TTPopup dismiss];
// [TTPopup dismiss];
[self didTapMinion];
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
self.isReceivePKResult = YES;
[self stopRoomPKCountDown];
@@ -528,6 +531,10 @@
return self.isPlaying;
}
- (BOOL)isPanelMinion {
return self.isMinion;
}
///
- (void)roomPKReceiveGift:(AttachmentModel *)attachment {
if (self.pkInfo.pkStatus != RoomPKStatusType_Playing) {
@@ -849,7 +856,7 @@
#pragma mark -
- (void)didTapMinion {
// TODO:
self.isMinion = true;
[self removeFromSuperview];
}
@@ -1251,7 +1258,6 @@
[transparentRoundedCornersBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.pkPanelContentView);
make.top.mas_equalTo(self.redTeamStackView.mas_bottom).offset(8);
// make.size.mas_equalTo(CGSizeMake(122, 30));
make.width.mas_greaterThanOrEqualTo(120);
make.height.mas_equalTo(30);
}];
@@ -1264,6 +1270,13 @@
make.size.mas_equalTo(CGSizeMake(13, 13));
}];
[transparentRoundedCornersBackgroundView addSubview:self.countDownLabel];
[self.countDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
make.right.mas_equalTo(transparentRoundedCornersBackgroundView.mas_right).offset(-6);
make.width.mas_greaterThanOrEqualTo(40);
}];
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPRoomPKProgressView11")
font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium]
textColor:[UIColor colorWithWhite:1 alpha:0.7]];
@@ -1271,14 +1284,7 @@
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
make.left.mas_equalTo(clockImageView.mas_right).offset(6);
}];
[transparentRoundedCornersBackgroundView addSubview:self.countDownLabel];
[self.countDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
make.left.mas_equalTo(titleLabel.mas_right).offset(6);
make.right.mas_equalTo(titleLabel.mas_right).offset(-6);
make.width.mas_equalTo(50);
make.right.mas_equalTo(self.countDownLabel.mas_left).offset(-6);
}];
}
@@ -1333,7 +1339,7 @@
[self.progressArea addSubview:self.fireImageView];
[self.fireImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.progressArea).offset(0);
make.centerX.mas_equalTo(self.progressArea);
make.centerY.mas_equalTo(self.progressArea).mas_offset(2);
make.height.mas_equalTo(35);
make.width.mas_equalTo(24);
@@ -1341,9 +1347,8 @@
[self.progressArea insertSubview:self.blueCountImageView aboveSubview:self.redCountImageView];
[self.blueCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.progressArea).offset(-47.5);
make.centerY.mas_equalTo(self.progressArea).mas_offset(4);
make.leading.mas_equalTo(self.fireImageView.mas_centerX);
make.right.top.mas_equalTo(self.redCountImageView);
make.left.mas_equalTo(self.fireImageView.mas_centerX);
make.height.mas_equalTo(14);
}];

View File

@@ -447,7 +447,7 @@
[self topImageFail];
} else { //
resultType = 2;
[self topImageFail];
[self topImageDraw];
}
[self descAreaGroupType:GroupType_Red];

View File

@@ -20,8 +20,8 @@
@property (nonatomic, strong) JXCategoryTitleView *titleView;
///lineView
@property (nonatomic, strong) JXCategoryListContainerView *pi_containerView;
///
@property (nonatomic,strong) UILabel *totalValueLabel;
/////
//@property (nonatomic,strong) UILabel *totalValueLabel;
///
@property (nonatomic,strong) UIButton *packGiftButton;
///
@@ -60,7 +60,7 @@
[self addSubview:self.titleView];
[self addSubview:self.pi_containerView];
[self addSubview:self.packGiftButton];
[self addSubview:self.totalValueLabel];
// [self addSubview:self.totalValueLabel];
[self addSubview:self.packGiftView];
}
@@ -74,20 +74,25 @@
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.equalTo(self);
make.height.mas_equalTo(44);
// make.leading.equalTo(self).offset(8);
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).offset(-16);
make.height.mas_equalTo(34);
make.width.mas_equalTo(kGetScaleWidth(200));
}];
[self.packGiftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-15);
make.centerY.height.mas_equalTo(self.titleView);
make.width.mas_equalTo(isMSRTL() ? 70:40);
}];
[self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
make.centerY.mas_equalTo(self.packGiftButton);
// make.top.mas_equalTo(2);
make.centerY.mas_equalTo(self.titleView);
// make.height.mas_equalTo(self.titleView);
// make.width.mas_equalTo(isMSRTL() ? 70:40);
make.size.mas_equalTo(CGSizeMake(20, 20));
}];
// [self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
// make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
// make.centerY.mas_equalTo(self.packGiftButton);
// }];
[self.pi_containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.equalTo(self);
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(0));
@@ -125,7 +130,7 @@
[self.titleView reloadData];
self.pi_containerView.hidden = NO;
self.packGiftView.hidden = YES;
self.totalValueLabel.hidden = YES;
// self.totalValueLabel.hidden = YES;
XPGiftInfoView *vc = [self getListVC:index];
self.segmentType = vc.segmentType;
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
@@ -179,30 +184,30 @@
[self.titleView reloadData];
self.packGiftView.hidden = NO;
self.pi_containerView.hidden = YES;
self.totalValueLabel.hidden = NO;
// self.totalValueLabel.hidden = NO;
self.segmentType = GiftSegmentType_Pack;
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
[self.delegate pIGiftInfoSegmentedView:self didClickSegment:self.segmentType];
}
}
- (void)createPackTotalValueAttribute {
__block NSInteger giftTotal = 0;
[self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:GiftInfoModel.class]) {
GiftInfoModel *gift = (GiftInfoModel *)obj;
if(gift.giftId != self.freeModel.giftId.integerValue){
giftTotal += gift.count * gift.goldPrice;
}
}
}];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
attachImage.bounds = CGRectMake(0, 0, 9, 9);
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
self.totalValueLabel.attributedText = str;
}
//- (void)createPackTotalValueAttribute {
// __block NSInteger giftTotal = 0;
// [self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
// if ([obj isKindOfClass:GiftInfoModel.class]) {
// GiftInfoModel *gift = (GiftInfoModel *)obj;
// if(gift.giftId != self.freeModel.giftId.integerValue){
// giftTotal += gift.count * gift.goldPrice;
// }
// }
// }];
// NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
// NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
// attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
// attachImage.bounds = CGRectMake(0, 0, 9, 9);
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
// self.totalValueLabel.attributedText = str;
//}
/**
xx.xxW29999W+
@param number
@@ -255,7 +260,7 @@
-(void)setPackOriginArray:(NSArray *)packOriginArray{
_packOriginArray = packOriginArray;
self.packGiftView.packOriginArray = packOriginArray;
[self createPackTotalValueAttribute];
// [self createPackTotalValueAttribute];
}
-(void)setFreeModel:(XPFreeGiftModel *)freeModel{
_freeModel = freeModel;
@@ -268,8 +273,12 @@
-(void)setRoomType:(RoomType)roomType{
_roomType = roomType;
if(_roomType == RoomType_Anchor){
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView3"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9"),YMLocalizedString(@"XPGiftInfoView8")];
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
YMLocalizedString(@"XPGiftInfoView3"),
YMLocalizedString(@"XPGiftInfoView4"),
YMLocalizedString(@"XPGiftInfoView9"),
YMLocalizedString(@"XPGiftInfoView8")];
self.titleView.titles = self.pi_titles;
[self.titleView reloadData];
@@ -279,7 +288,9 @@
_usingplaceType = usingplaceType;
self.packGiftView.usingplaceType = _usingplaceType;
if (_usingplaceType == SendGiftType_User) {
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9")];
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
YMLocalizedString(@"XPGiftInfoView4"),
YMLocalizedString(@"XPGiftInfoView9")];
self.titleView.titles = self.pi_titles;
[self.titleView reloadData];
self.titleView.titleColor = [DJDKMIMOMColor secondTextColor];
@@ -347,20 +358,21 @@
}
return _pi_containerView;
}
- (UILabel *)totalValueLabel {
if (!_totalValueLabel) {
_totalValueLabel = [[UILabel alloc] init];
_totalValueLabel.hidden = YES;
_totalValueLabel.textAlignment = NSTextAlignmentRight;
}
return _totalValueLabel;
}
//- (UILabel *)totalValueLabel {
// if (!_totalValueLabel) {
// _totalValueLabel = [[UILabel alloc] init];
// _totalValueLabel.hidden = YES;
// _totalValueLabel.textAlignment = NSTextAlignmentRight;
// }
// return _totalValueLabel;
//}
- (UIButton *)packGiftButton {
if (!_packGiftButton) {
_packGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
[_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
_packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
// [_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
// [_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
// _packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
[_packGiftButton setBackgroundImage:[UIImage imageNamed:@"gift_bag_icon"] forState:UIControlStateNormal];
_packGiftButton.tag = GiftSegmentType_Pack;
[_packGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
}

View File

@@ -23,7 +23,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
///线
@property (nonatomic, strong) UIView *bottomDevideView;
///
@property (nonatomic, strong) UIImageView *arrowImageView;
//@property (nonatomic, strong) UIImageView *arrowImageView;
///
@@ -53,7 +53,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
// [self addSubview:self.devideView];
// [self addSubview:self.interactButton];
[self addSubview:self.arrowImageView];
// [self addSubview:self.arrowImageView];
[self addSubview:self.pi_BannerView];
[self addSubview:self.bottomDevideView];
@@ -69,11 +69,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
make.centerY.mas_equalTo(self);
make.width.mas_equalTo(40);
}];
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
make.centerX.mas_equalTo(self.giftButton);
make.size.mas_equalTo(CGSizeMake(9, 7));
}];
// [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
// make.centerX.mas_equalTo(self.giftButton);
// make.size.mas_equalTo(CGSizeMake(9, 7));
// }];
// [self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) {
// make.centerY.mas_equalTo(self);
// make.leading.mas_equalTo(self.devideView.mas_trailing).mas_offset(8);
@@ -129,11 +129,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
sender.selected = YES;
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
make.centerX.mas_equalTo(self.giftButton);
make.size.mas_equalTo(CGSizeMake(9, 7));
}];
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
// make.centerX.mas_equalTo(self.giftButton);
// make.size.mas_equalTo(CGSizeMake(9, 7));
// }];
}
- (void)interactButtonAction:(UIButton *)sender {
@@ -149,11 +149,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
self.giftButton.titleLabel.font = [UIFont systemFontOfSize:14];
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
make.centerX.mas_equalTo(self.giftButton);
make.size.mas_equalTo(CGSizeMake(9, 7));
}];
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
// make.centerX.mas_equalTo(self.giftButton);
// make.size.mas_equalTo(CGSizeMake(9, 7));
// }];
}
#pragma mark - setter
@@ -220,14 +220,14 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
return _titleArray;
}
- (UIImageView *)arrowImageView {
if (!_arrowImageView) {
UIImageView *imageView = [[UIImageView alloc] init];
imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
_arrowImageView = imageView;
}
return _arrowImageView;
}
//- (UIImageView *)arrowImageView {
// if (!_arrowImageView) {
// UIImageView *imageView = [[UIImageView alloc] init];
// imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
//
// _arrowImageView = imageView;
// }
// return _arrowImageView;
//}
@end