修改了一些UI的问题

This commit is contained in:
fengshuo
2022-03-30 20:26:16 +08:00
committed by chenguilong
parent 2bf04ad1b8
commit b0abab8104
9 changed files with 69 additions and 16 deletions

View File

@@ -160,8 +160,8 @@
if (!self.gameListView.superview) {
[self addSubview:self.gameListView];
[self.gameListView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).offset(-75);
make.top.mas_equalTo(self).offset(28 + kSafeAreaTopHeight - 3 * kScreenScale);
make.right.mas_equalTo(self).offset(-85);
make.top.mas_equalTo(self).offset(kNavigationHeight - 14 - 11 - 25.0 / 2.0);
}];
}
self.gameListView.mgId = roomInfo.mgId > 0 ? [NSString stringWithFormat:@"%lld", roomInfo.mgId] : @"-1";
@@ -260,7 +260,7 @@
[self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
self.anchorGiftValueView.hidden = YES;
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationHeight + 4);
make.top.mas_equalTo(kNavigationHeight);
}];
}
[self updateRoomTopic];
@@ -315,7 +315,7 @@
[self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
self.anchorGiftValueView.hidden = YES;
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationHeight + 4);
make.top.mas_equalTo(kNavigationHeight);
}];
}
@@ -794,7 +794,7 @@
if (!_contributionButton) {
_contributionButton = [[UIButton alloc]init];
[_contributionButton addTarget:self action:@selector(contributionButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_contributionButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
_contributionButton.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
[_contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
[_contributionButton setImage:[UIImage imageNamed:@"room_rank_enter_icon"] forState:UIControlStateNormal];
[_contributionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
@@ -876,7 +876,6 @@
- (XPLittleGameMiniStageView *)littleGameMiniView {
if (!_littleGameMiniView) {
_littleGameMiniView = [[XPLittleGameMiniStageView alloc] init];
_littleGameMiniView.delegate = self;
}
return _littleGameMiniView;
}

View File

@@ -11,7 +11,6 @@
///Tool
#import "ThemeColor.h"
#import "Api+LittleGame.h"
#import "XPMacro.h"
///Model
#import "LittleGameInfoModel.h"
#import "XPLittleGameTableViewCell.h"
@@ -66,11 +65,11 @@
}];
[self.gamePlayButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(25 * kScreenScale);
make.height.mas_equalTo(25);
}];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(25 * kScreenScale);
make.height.mas_equalTo(25);
}];
}
@@ -106,7 +105,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 25 * kScreenScale;
return 25;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -156,7 +155,7 @@
- (void)setDatasource:(NSArray *)datasource {
_datasource = datasource;
[self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(25 * kScreenScale * self.datasource.count);
make.height.mas_equalTo(25 * self.datasource.count);
}];
[self.tableView reloadData];
}

View File

@@ -10,7 +10,8 @@
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomMessageHeaderView : UIView
///头部的背景颜色
@property (nonatomic,strong) UIColor *bubbleColor;
@end
NS_ASSUME_NONNULL_END

View File

@@ -64,6 +64,13 @@
}
#pragma mark - Getters And Setters
- (void)setBubbleColor:(UIColor *)bubbleColor {
_bubbleColor = bubbleColor;
if (_bubbleColor) {
_bubbleView.backgroundColor = _bubbleColor;
}
}
- (UIView *)bubbleView {
if (!_bubbleView) {
_bubbleView = [[UIView alloc] init];

View File

@@ -6,7 +6,7 @@
//
#import <UIKit/UIKit.h>
#import "RoomInfoModel.h"
@class XPNetImageYYLabel;
NS_ASSUME_NONNULL_BEGIN
@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface XPRoomMessageTableViewCell : UITableViewCell
///当前房间的类型
@property (nonatomic,assign) RoomType roomType;
@property (nonatomic,strong) NSAttributedString *attributedString;
///气泡url

View File

@@ -103,10 +103,42 @@
self.bubbleImageView.image = [self resizableImage:image1];
}];
} else {
self.bubbleImageView.image = [UIImage imageWithColor:[ThemeColor messageBubbleColor]];
if (_roomType == RoomType_MiniGame) {
_bubbleImageView.image = [UIImage imageWithColor:[UIColor colorWithWhite:1 alpha:0.2]];
} else {
_bubbleImageView.image = [UIImage imageWithColor:[ThemeColor messageBubbleColor]];
}
}
}
- (UIImage *)scaleToSize:(UIImage *)img {
// bitmapcontext
// 使context
CGFloat width = img.size.width * 0.5;
CGFloat height = img.size.height * 0.5;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), NO, 1);
//
[img drawInRect:CGRectMake(0, 0, width, height)];
// context
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
// 使context
UIGraphicsEndImageContext();
//
return scaledImage;
}
- (void)setRoomType:(RoomType)roomType {
_roomType = roomType;
if (self.bubbleImageUrl.length > 0) {
return;
}
if (_roomType == RoomType_MiniGame) {
_bubbleImageView.image = [UIImage imageWithColor:[UIColor colorWithWhite:1 alpha:0.2]];
} else {
_bubbleImageView.image = [UIImage imageWithColor:[ThemeColor messageBubbleColor]];
}
}
- (NetImageView *)bubbleImageView {
if (!_bubbleImageView) {
_bubbleImageView = [[NetImageView alloc] init];

View File

@@ -20,6 +20,7 @@
#import "PLTimeUtil.h"
#import "ClientConfig.h"
#import <POP.h>
#import "ThemeColor+Room.h"
///Model
#import "RoomInfoModel.h"
#import "AttachmentModel.h"
@@ -460,6 +461,15 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
- (void)onRoomEntered {
[[XPRoomMiniManager shareManager] resetLocalMessage];
self.headerView.bubbleColor = self.hostDelegate.getRoomInfo.type == RoomType_MiniGame ? [UIColor colorWithWhite:1 alpha:0.2] : [ThemeColor messageBubbleColor];
}
- (void)onRoomUpdate {
///
if (self.hostDelegate.getRoomInfo.hadChangeRoomType) {
self.headerView.bubbleColor = self.hostDelegate.getRoomInfo.type == RoomType_MiniGame ? [UIColor colorWithWhite:1 alpha:0.2] : [ThemeColor messageBubbleColor];
[self.messageTableView reloadData];
}
}
#pragma mark - ScrollViewDelegate
@@ -523,6 +533,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
NSAttributedString* attr = [self.datasource objectAtIndex:indexPath.row];
NSString *bubbleStr = [self.messageBubbles objectAtIndex:indexPath.row];
cell.bubbleImageUrl = bubbleStr;
cell.roomType = self.hostDelegate.getRoomInfo.type;
cell.attributedString = attr;
return cell;
}

View File

@@ -38,6 +38,7 @@
[super configMicroView:model];
UserInfoModel * info = model.userInfo;
self.stateButton.hidden = NO;
self.sexImageView.hidden = YES;
if (info.uid == self.getRoomInfo.uid) {//
[self.stateButton setTitle:@"房主" forState:UIControlStateNormal];
[self.stateButton setBackgroundColor:UIColorFromRGB(0x20AAF5)];
@@ -46,13 +47,13 @@
self.stateButton.hidden = YES;
} else if (info.gameStatus == LittleGamePlayStatus_IsIn) {
[self.stateButton setTitle:@"未准备" forState:UIControlStateNormal];
[self.stateButton setBackgroundColor:UIColorFromRGB(0xFFA936)];
[self.stateButton setBackgroundColor:UIColorFromRGB(0xFC4F6D)];
} else if (info.gameStatus == LittleGamePlayStatus_Ready) {
[self.stateButton setTitle:@"已准备" forState:UIControlStateNormal];
[self.stateButton setBackgroundColor:UIColorFromRGB(0x56D41A)];
} else if (info.gameStatus == LittleGamePlayStatus_Plying) {
[self.stateButton setTitle:@"游戏中" forState:UIControlStateNormal];
[self.stateButton setBackgroundColor:UIColorFromRGB(0x56D41A)];
[self.stateButton setBackgroundColor:UIColorFromRGB(0xFFA936)];
} else {
self.stateButton.hidden = YES;
}

View File

@@ -546,6 +546,7 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
[self.menuContainerView onRoomUpdate];
[self.functionView onRoomUpdate];
[self.activityContainerView onRoomUpdate];
[self.messageContainerView onRoomUpdate];
[self.littleGameView onRoomUpdate];
}
break;