小喇叭展示
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#import "XPRoomMessageTableViewCell.h"
|
||||
#import "XPRoomMessageHeaderView.h"
|
||||
#import "View/XPRoomMessageHeaderView.h"
|
||||
#import "XPRoomTrumpetView.h"
|
||||
|
||||
NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
|
||||
@@ -50,6 +51,10 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
@property (nonatomic,strong) NSMutableArray<NIMMessage *> *incomingMessages;
|
||||
///messageView 持有这个工具类 进行数据的分发操作 TODO: 有需要在改
|
||||
@property (nonatomic,strong) XPRoomMessageParser *messageParser;
|
||||
///小喇叭
|
||||
@property (nonatomic, strong) XPRoomTrumpetView *trumpetView;
|
||||
///小喇叭队列
|
||||
@property (nonatomic, strong) NSMutableArray *trumpetQueue;
|
||||
@end
|
||||
|
||||
|
||||
@@ -82,6 +87,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
[self addSubview:self.messageTableView];
|
||||
[self addSubview:self.messageTipsBtn];
|
||||
self.messageTableView.tableHeaderView = self.headerView;
|
||||
[self addSubview:self.trumpetView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -96,6 +102,12 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
make.bottom.mas_equalTo(self.mas_bottom).offset(-5);
|
||||
make.left.mas_equalTo(self);
|
||||
}];
|
||||
[self.trumpetView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self);
|
||||
make.left.mas_equalTo(15);
|
||||
make.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(32);
|
||||
}];
|
||||
}
|
||||
|
||||
///是否是当前房间
|
||||
@@ -323,7 +335,14 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
[[XPRoomMiniManager shareManager] resetLocalMessage];
|
||||
[self addRoomMessage:message];
|
||||
return;
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Trumpet) {
|
||||
if (self.trumpetView.isHidden) {
|
||||
self.trumpetView.hidden = NO;
|
||||
}
|
||||
[self.trumpetQueue addObject:attachment.data];
|
||||
self.trumpetView.data = attachment.data;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (self.hostDelegate.getRoomInfo.isCloseScreen) {
|
||||
return;
|
||||
@@ -522,4 +541,19 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
return _messageParser;
|
||||
}
|
||||
|
||||
- (XPRoomTrumpetView *)trumpetView {
|
||||
if (!_trumpetView) {
|
||||
_trumpetView = [[XPRoomTrumpetView alloc] init];
|
||||
_trumpetView.hidden = YES;
|
||||
}
|
||||
return _trumpetView;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)trumpetQueue {
|
||||
if (!_trumpetQueue) {
|
||||
_trumpetQueue = [NSMutableArray array];
|
||||
}
|
||||
return _trumpetQueue;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user