@@ -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{
|
||||
|
@@ -48,17 +48,11 @@
|
||||
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];
|
||||
|
@@ -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);
|
||||
|
@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
@interface XPAcrossRoomPKPanelView : UIView
|
||||
- (void)startInitUI;
|
||||
///开启pk
|
||||
- (void)openCountdownWithTime:(long)time;
|
||||
///pk 信息
|
||||
|
@@ -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,14 +108,18 @@ 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:)];
|
||||
// 这里的delaysTouchesBegan属性很明显就是对touchBegin方法是否进行延迟,
|
||||
// YES表示延迟,即在系统未识别出来手势为什么手势时先不要调用touchesBegan 方法;
|
||||
// NO表示不延迟,即在系统未识别出来手势为什么手势时会先调用touchesBegan 方法;
|
||||
pan.delaysTouchesBegan = YES;
|
||||
[self addGestureRecognizer:pan];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)startInitUI {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
@@ -126,8 +131,6 @@ static CGFloat MiniHeight = 130.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Public Method
|
||||
- (void)resetAcrossPKViewData {
|
||||
@@ -140,12 +143,9 @@ 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 +155,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 +250,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 +258,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 +288,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 +366,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 +479,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.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.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 +505,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 +545,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 +582,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 +710,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 +907,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 {
|
||||
|
@@ -253,7 +253,6 @@
|
||||
///房间内PK是否正在进行
|
||||
- (BOOL)isRoomPKPlaying {
|
||||
return [self.pkPanelView isRoomPKPlaying];
|
||||
// return [self.roompkPanelView isRoomPKPlaying];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
@@ -465,7 +464,9 @@
|
||||
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
||||
|
||||
self.pkPanelView.roomInfo = roomInfo;
|
||||
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){
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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);
|
||||
}];
|
||||
|
||||
|
Reference in New Issue
Block a user