房间公屏UI更改
This commit is contained in:
@@ -291,6 +291,7 @@
|
||||
237852A12C072D8D00E360AC /* MSRoomGameModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A02C072D8D00E360AC /* MSRoomGameModel.m */; };
|
||||
237852A42C082A9800E360AC /* MSRoomGameSendTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */; };
|
||||
237852A72C08764B00E360AC /* MSRoomGameResultsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */; };
|
||||
237852AA2C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */; };
|
||||
237B94BC2A984DA7007853E3 /* XPTrumpetPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */; };
|
||||
237B94BD2A984DA7007853E3 /* XPNobleTrumpetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B32A984DA7007853E3 /* XPNobleTrumpetModel.m */; };
|
||||
237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B72A984DA7007853E3 /* XPRoomTrumpetViewController.m */; };
|
||||
@@ -2116,6 +2117,8 @@
|
||||
237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameSendTextView.m; sourceTree = "<group>"; };
|
||||
237852A52C08764B00E360AC /* MSRoomGameResultsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSRoomGameResultsModel.h; sourceTree = "<group>"; };
|
||||
237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameResultsModel.m; sourceTree = "<group>"; };
|
||||
237852A82C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MsRoomMessagChatHallHeadView.h; sourceTree = "<group>"; };
|
||||
237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MsRoomMessagChatHallHeadView.m; sourceTree = "<group>"; };
|
||||
237B94AD2A984DA7007853E3 /* XPTrumpetPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTrumpetPresenter.h; sourceTree = "<group>"; };
|
||||
237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTrumpetPresenter.m; sourceTree = "<group>"; };
|
||||
237B94B02A984DA7007853E3 /* XPRoomTrumpetProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -10185,6 +10188,8 @@
|
||||
E8AEAEF227141C7C0017FCE0 /* XPRoomMessageContainerView.m */,
|
||||
235714932BEDF517004C81D6 /* MsRoomMessagChatHallView.h */,
|
||||
235714942BEDF517004C81D6 /* MsRoomMessagChatHallView.m */,
|
||||
237852A82C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.h */,
|
||||
237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */,
|
||||
);
|
||||
path = MessageContainerView;
|
||||
sourceTree = "<group>";
|
||||
@@ -11828,6 +11833,7 @@
|
||||
237700FA2BCCD25500D661F1 /* YYLabel+MSRTL.m in Sources */,
|
||||
E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */,
|
||||
E8F6135C291E26BD00E12650 /* NSMutableDictionary+Saft.m in Sources */,
|
||||
237852AA2C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m in Sources */,
|
||||
239D0F992BFB43BC002977CE /* MSRoomOnLineAvatarView.m in Sources */,
|
||||
1427213429A75A2600C7C423 /* XPMonentsLatestPresenter.m in Sources */,
|
||||
E83ABEFD280EB5E200322EE4 /* ContentOpenLiveInfoModel.m in Sources */,
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MsRoomMessagChatHallHeadView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/6/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MsRoomMessagChatHallHeadView : UIView
|
||||
@property(nonatomic,copy) NSString *content;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// MsRoomMessagChatHallHeadView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2024/6/3.
|
||||
//
|
||||
|
||||
#import "MsRoomMessagChatHallHeadView.h"
|
||||
@interface MsRoomMessagChatHallHeadView()
|
||||
@property(nonatomic,strong) UILabel *titleView;
|
||||
@end
|
||||
@implementation MsRoomMessagChatHallHeadView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
self.layer.cornerRadius = 7;
|
||||
self.layer.masksToBounds = YES;
|
||||
self.layer.borderWidth = 1;
|
||||
[self addSubview:self.titleView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self).offset(10);
|
||||
}];
|
||||
}
|
||||
-(void)setContent:(NSString *)content{
|
||||
_content = content;
|
||||
_titleView.text = _content;
|
||||
[_titleView.superview layoutIfNeeded];
|
||||
// UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE3B462),UIColorFromRGB(0x723505)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
||||
// self.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
// UIImage *borderImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF7D364),UIColorFromRGB(0xFFFAE4),UIColorFromRGB(0xF7D364)] gradientType:GradientTypeLeftToRight imgSize:self.frame.size];
|
||||
// self.layer.borderColor = [UIColor colorWithPatternImage:borderImage].CGColor;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UILabel *)titleView{
|
||||
if(!_titleView){
|
||||
_titleView = [UILabel labelInitWithText:@"" font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xFFF6E1)];
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
@end
|
@@ -47,6 +47,7 @@
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
#import "MsRoomMessagChatHallCell.h"
|
||||
#import "MSSessionPublicChatHallTopModel.h"
|
||||
#import "MsRoomMessagChatHallHeadView.h"
|
||||
@interface MsRoomMessagChatHallView ()<UITableViewDelegate, UITableViewDataSource, XPRoomMessageTableViewCellDelegate, UIGestureRecognizerDelegate,PIRoomMessagePhotoAlbumCellDelegate,SDPhotoBrowserDelegate,PIRoomMessageUnlockPhotoAlbumViewDelegate>
|
||||
///房间的代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> hostDelegate;
|
||||
@@ -54,8 +55,8 @@
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *messageTableView;
|
||||
///头部
|
||||
@property (nonatomic,strong) UIView *headerView;
|
||||
@property(nonatomic,strong) UILabel *titleView;
|
||||
@property (nonatomic,strong) MsRoomMessagChatHallHeadView *headerView;
|
||||
|
||||
///messageView 持有这个工具类 进行数据的分发操作 TODO: 有需要在改
|
||||
@property (nonatomic,strong) XPRoomMessageParser *messageParser;
|
||||
|
||||
@@ -104,14 +105,13 @@
|
||||
- (void)initSubViews {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addCustomMessage:) name:@"message" object:nil];
|
||||
[self addSubview:self.headerView];
|
||||
[self.headerView addSubview:self.titleView];
|
||||
[self addSubview:self.messageTableView];
|
||||
|
||||
[Api getPublicChatHallTopText:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
MSSessionPublicChatHallTopModel *model = [MSSessionPublicChatHallTopModel modelWithDictionary:data.data];
|
||||
if(model != nil){
|
||||
self.titleView.text = model.content;
|
||||
self.headerView.content = model.content;
|
||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.top.trailing.mas_equalTo(self);
|
||||
@@ -138,9 +138,6 @@
|
||||
make.height.mas_greaterThanOrEqualTo(0);
|
||||
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.top.bottom.equalTo(self.headerView).inset(10);
|
||||
}];
|
||||
[self.messageTableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.bottom.trailing.mas_equalTo(self);
|
||||
@@ -178,7 +175,7 @@
|
||||
if(attachment.first == CustomMessageType_Chat_Hall_Headlinesn && attachment.second == Custom_Message_Sub_Chat_Hall_Headlinesn){
|
||||
MSSessionPublicChatHallTopModel *topModel = [MSSessionPublicChatHallTopModel modelWithDictionary:attachment.data];
|
||||
if(topModel.recordStatus == 1){
|
||||
self.titleView.text = topModel.content;
|
||||
self.headerView.content = topModel.content;
|
||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.top.trailing.mas_equalTo(self);
|
||||
@@ -186,7 +183,7 @@
|
||||
|
||||
}];
|
||||
}else{
|
||||
self.titleView.text = topModel.content;
|
||||
self.headerView.content = topModel.content;
|
||||
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.top.trailing.mas_equalTo(self);
|
||||
@@ -233,7 +230,6 @@
|
||||
- (void)handleNIMCustomMessage:(NIMMessage *)message {
|
||||
self.isMiniEnter = NO;
|
||||
if ([self isCanDisplayMessage:message]) {
|
||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||
[self addRoomMessage:message];
|
||||
}
|
||||
}
|
||||
@@ -261,7 +257,7 @@
|
||||
self.isMiniEnter = NO;
|
||||
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
|
||||
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
|
||||
|
||||
if (content.eventType == NIMChatroomEventTypeEnter) {
|
||||
|
||||
|
||||
@@ -435,18 +431,18 @@
|
||||
}
|
||||
}];
|
||||
|
||||
self.headerView.backgroundColor = UIColorRGBAlpha(0xADF4FF, 0.2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)onRoomEntered {
|
||||
self.headerView.backgroundColor = UIColorRGBAlpha(0xADF4FF, 0.2);
|
||||
|
||||
}
|
||||
|
||||
- (void)onRoomUpdate {
|
||||
///改变公屏的背景样式
|
||||
if (self.hostDelegate.getRoomInfo.hadChangeRoomType) {
|
||||
self.headerView.backgroundColor = UIColorRGBAlpha(0xADF4FF, 0.2);
|
||||
|
||||
[self.messageTableView reloadData];
|
||||
}
|
||||
}
|
||||
@@ -621,11 +617,9 @@
|
||||
return _messageTableView;
|
||||
}
|
||||
|
||||
- (UIView *)headerView {
|
||||
- (MsRoomMessagChatHallHeadView *)headerView {
|
||||
if (!_headerView) {
|
||||
_headerView = [[UIView alloc] init];
|
||||
_headerView.layer.cornerRadius = 7;
|
||||
_headerView.layer.masksToBounds = YES;
|
||||
_headerView = [[MsRoomMessagChatHallHeadView alloc] initWithFrame:CGRectZero];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
@@ -649,13 +643,6 @@
|
||||
}
|
||||
return _messageParser;
|
||||
}
|
||||
- (UILabel *)titleView{
|
||||
if(!_titleView){
|
||||
_titleView = [UILabel labelInitWithText:@"" font:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x05FFE3)];
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
_titleView.numberOfLines = 0;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user