消息页面UI修改

This commit is contained in:
chenshuanglin
2023-03-08 18:52:49 +08:00
parent f8e2c5e0a1
commit 47408eb687
18 changed files with 210 additions and 53 deletions

View File

@@ -14,6 +14,7 @@
14C1F15429B86DF0000A960F /* XPMineMoreTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C1F15329B86DF0000A960F /* XPMineMoreTableViewCell.m */; };
14C1F15729B874FB000A960F /* XPMineMoreItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C1F15629B874FB000A960F /* XPMineMoreItemTableViewCell.m */; };
14C1F15A29B876EC000A960F /* XPMineMoreItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C1F15929B876EC000A960F /* XPMineMoreItemModel.m */; };
14C1F15D29B88DEE000A960F /* XPMessageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C1F15C29B88DEE000A960F /* XPMessageViewController.m */; };
14EDBBAA29B5935F001D3E16 /* XPFindNewFriendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBA929B5935F001D3E16 /* XPFindNewFriendViewController.m */; };
14EDBBB329B5F7B2001D3E16 /* XPButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBB229B5F7B2001D3E16 /* XPButton.m */; };
14EDBBB629B600DC001D3E16 /* XPNewMomentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBB529B600DC001D3E16 /* XPNewMomentsViewController.m */; };
@@ -1303,6 +1304,8 @@
14C1F15629B874FB000A960F /* XPMineMoreItemTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMoreItemTableViewCell.m; sourceTree = "<group>"; };
14C1F15829B876EC000A960F /* XPMineMoreItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineMoreItemModel.h; sourceTree = "<group>"; };
14C1F15929B876EC000A960F /* XPMineMoreItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMoreItemModel.m; sourceTree = "<group>"; };
14C1F15B29B88DEE000A960F /* XPMessageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMessageViewController.h; sourceTree = "<group>"; };
14C1F15C29B88DEE000A960F /* XPMessageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMessageViewController.m; sourceTree = "<group>"; };
14EDBBA829B5935F001D3E16 /* XPFindNewFriendViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFindNewFriendViewController.h; sourceTree = "<group>"; };
14EDBBA929B5935F001D3E16 /* XPFindNewFriendViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFindNewFriendViewController.m; sourceTree = "<group>"; };
14EDBBB129B5F7B2001D3E16 /* XPButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPButton.h; sourceTree = "<group>"; };
@@ -4261,6 +4264,8 @@
18A61BE7274F9CF000A09A54 /* SessionListViewController.m */,
18EE3FDD2750C1F700A452BF /* SessionListCell.h */,
18EE3FDE2750C1F700A452BF /* SessionListCell.m */,
14C1F15B29B88DEE000A960F /* XPMessageViewController.h */,
14C1F15C29B88DEE000A960F /* XPMessageViewController.m */,
);
path = SessionList;
sourceTree = "<group>";
@@ -10250,6 +10255,7 @@
E81AF32527F1D5B8003B9E43 /* XPRoomPKProgressView.m in Sources */,
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */,
9B6E8577281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m in Sources */,
14C1F15D29B88DEE000A960F /* XPMessageViewController.m in Sources */,
E8E859D628264C2300EE4857 /* DispatchQueueLogFormatter.m in Sources */,
E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */,
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -24,6 +24,8 @@ typedef NS_ENUM(NSUInteger, SessionListOpenType) {
/** 控制器 因为房间内聊天没有控制器去push 或者做其他的操作*/
@property (nonatomic, weak) UIViewController * mainController;
/// 全部已读
- (void)allRead;
@end

View File

@@ -29,11 +29,6 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
@interface SessionListViewController ()<UITableViewDataSource, UITableViewDelegate, NIMLoginManagerDelegate, NIMConversationManagerDelegate, XPSessionListHeadViewDelegate>
@property (nonatomic,strong) UIView *customNavigationBar;
@property (nonatomic,strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *allReadButton;
@property (nonatomic, strong) XPSessionListHeadView *headView;
/**
*
@@ -139,29 +134,18 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
} uid:uid];
}
- (void)initViews {
self.title = @"消息";
if (self.openType == SessionListOpenTypeDefault) {
[self.customNavigationBar addSubview:self.titleLabel];
[self.view addSubview:self.customNavigationBar];
[self.customNavigationBar addSubview:self.allReadButton];
[self.view addSubview:self.headView];
self.view.backgroundColor = UIColor.clearColor;
}
[self.view addSubview:self.sessionListView];
}
- (void)initLayout {
if (self.openType == SessionListOpenTypeDefault) {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.customNavigationBar);
}];
[self.allReadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.width.height.mas_equalTo(30);
make.centerY.mas_equalTo(self.customNavigationBar);
}];
[self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.mas_equalTo(self.customNavigationBar.mas_bottom).mas_offset(8);
make.top.mas_equalTo(8);
}];
}
@@ -413,7 +397,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
}
#pragma mark - action
- (void)allReadButtonClick:(UIButton *)sender {
- (void)allRead {
NSInteger count = [NIMSDK sharedSDK].conversationManager.allUnreadCount;
if (count<1) {
[self showErrorToast:@"暂无未读消息需要清理"];
@@ -435,26 +419,6 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
}];
}
- (UIView *)customNavigationBar {
if (!_customNavigationBar) {
CGRect frame = CGRectMake(0, kStatusBarHeight, KScreenWidth, 44);
_customNavigationBar = [[UIView alloc]initWithFrame:frame];
}
return _customNavigationBar;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_titleLabel.backgroundColor = [UIColor clearColor];
_titleLabel.font = [UIFont systemFontOfSize:18.f weight:UIFontWeightMedium];
_titleLabel.textColor = ThemeColor.mainTextColor;
_titleLabel.text = @"消息";
}
return _titleLabel;
}
- (UITableView *)sessionListView {
if (!_sessionListView) {
_sessionListView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
@@ -474,15 +438,6 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
return _recentSessions;
}
- (UIButton *)allReadButton {
if (!_allReadButton) {
_allReadButton = [[UIButton alloc] init];
[_allReadButton setImage:[UIImage imageNamed:@"sessionList_clear"] forState:UIControlStateNormal];
[_allReadButton addTarget:self action:@selector(allReadButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _allReadButton;
}
- (XPTeenagerHomeView *)teenagerView {
if (!_teenagerView) {
_teenagerView = [[XPTeenagerHomeView alloc] init];

View File

@@ -0,0 +1,16 @@
//
// XPMessageViewController.h
// xplan-ios
//
// Created by XY on 2023/3/8.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMessageViewController : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,174 @@
//
// XPMessageViewController.m
// xplan-ios
//
// Created by XY on 2023/3/8.
//
#import "XPMessageViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <JXCategoryView.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
///VC
#import "SessionListViewController.h"
#import "XPMineFriendViewController.h"
@interface XPMessageViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate>
@property (nonatomic,strong) UIImageView *topGradientImageView;
///
@property (nonatomic, strong) JXCategoryTitleView *titleView;
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
@property (nonatomic, strong) NSArray<NSString *> *titles;
///
@property (nonatomic, strong) UIButton *allReadButton;
@property (nonatomic, strong) SessionListViewController *sessionVC;
@property (nonatomic, strong) XPMineFriendViewController *friendVC;
@end
@implementation XPMessageViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.topGradientImageView];
[self.view addSubview:self.titleView];
[self.view addSubview:self.allReadButton];
[self.view addSubview:self.listContainerView];
}
- (void)initSubViewConstraints {
[self.topGradientImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.right.mas_equalTo(0);
make.height.mas_equalTo(125);
}];
[self.allReadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-15);
make.width.height.mas_equalTo(20);
make.centerY.mas_equalTo(self.titleView);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight);
make.left.mas_equalTo(5);
make.right.mas_equalTo(self.allReadButton.mas_left).offset(10);
make.height.mas_equalTo(50);
}];
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleView.mas_bottom);
make.left.right.mas_equalTo(0);
make.bottom.mas_equalTo(0);
}];
}
#pragma mark - action
- (void)allReadButtonClick:(UIButton *)sender {
[self.sessionVC allRead];
}
#pragma mark - JXCategoryListContainerViewDelegate
//
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
return self.titles.count;
}
// <JXCategoryListContentViewDelegate>
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
if (index == 0) {
return self.sessionVC;
}else{
return self.friendVC;
}
}
#pragma mark - Getters And Setters
- (UIImageView *)topGradientImageView {
if (!_topGradientImageView) {
_topGradientImageView = [[UIImageView alloc] init];
_topGradientImageView.image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#DCF6FF"], [ThemeColor colorWithHexString:@"#F8F8FA"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(KScreenWidth, 125)];
_topGradientImageView.contentMode = UIViewContentModeScaleToFill;
}
return _topGradientImageView;
}
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.backgroundColor = [UIColor clearColor];
_titleView.titleColor = [ThemeColor textThirdColor];
_titleView.titleSelectedColor = [ThemeColor mainTextColor];
_titleView.titleFont = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_titleView.titleSelectedFont = [UIFont systemFontOfSize:22 weight:UIFontWeightSemibold];
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.averageCellSpacingEnabled = NO;
_titleView.titles = self.titles;
_titleView.cellSpacing = 20;
_titleView.listContainer = self.listContainerView;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorImageViewSize = CGSizeMake(13, 4);
lineView.verticalMargin = 5;
lineView.indicatorImageView.image = [UIImage imageNamed:@"home_segment_indicator"];
_titleView.indicators = @[lineView];
}
return _titleView;
}
//
- (JXCategoryListContainerView *)listContainerView {
if (!_listContainerView) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
}
return _listContainerView;
}
- (UIButton *)allReadButton {
if (!_allReadButton) {
_allReadButton = [[UIButton alloc] init];
[_allReadButton setImage:[UIImage imageNamed:@"sessionList_clear"] forState:UIControlStateNormal];
[_allReadButton addTarget:self action:@selector(allReadButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _allReadButton;
}
- (NSArray<NSString *> *)titles {
if (!_titles) {
_titles = @[@"消息", @"好友"];
}
return _titles;
}
- (SessionListViewController *)sessionVC {
if (!_sessionVC) {
_sessionVC = [[SessionListViewController alloc] init];
}
return _sessionVC;
}
- (XPMineFriendViewController *)friendVC {
if (!_friendVC) {
_friendVC = [[XPMineFriendViewController alloc] init];
}
return _friendVC;
}
@end

View File

@@ -62,8 +62,9 @@ NSString * const kMengXinShowReadDotKey = @"kMengXinShowReadDotKey";
subscribeItem.type = XPSessionListHeadItemType_Subscribe;
[self.funtionArray addObject:officeItem];
[self.funtionArray addObject:activityItem];
[self.funtionArray addObject:subscribeItem];
[self.funtionArray addObject:activityItem];
}
- (void)initView {
@@ -89,7 +90,7 @@ NSString * const kMengXinShowReadDotKey = @"kMengXinShowReadDotKey";
}];
[self.toolStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(75);
make.height.mas_equalTo(90);
}];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -42,7 +42,7 @@
}
- (BOOL)isHiddenNavBar {
return self.type == ContactUseingType_In_Room ? YES : NO;
return (self.type == ContactUseingType_In_Room || self.type == ContactUseingType_Normal) ? YES : NO;
}
- (void)viewDidLoad {
@@ -61,6 +61,7 @@
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = UIColor.clearColor;
[self.view addSubview:self.tableView];
}

View File

@@ -78,6 +78,7 @@
#import "XPNewHomeViewController.h"
#import "XPNewMomentsViewController.h"
#import "XPPartyViewController.h"
#import "XPMessageViewController.h"
///Present
#import "MainPresenter.h"
#import "MainProtocol.h"
@@ -522,7 +523,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
#else
[fvcGame setName:@"/" uniqueId:nil params:nil];
#endif
msg = [[SessionListViewController alloc] init];
// msg = [[SessionListViewController alloc] init];
msg = [[XPMessageViewController alloc] init];
me = [[XPMineViewController alloc] init];
party = [[XPPartyViewController alloc]init];
// home = [[XPHomeViewController alloc] init];
@@ -531,7 +533,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
monents = [[XPNewMomentsViewController alloc] init];
} else {
party = [[BaseViewController alloc]init];
msg = [[SessionListViewController alloc]init];
msg = [[XPMessageViewController alloc]init];
me = [[BaseViewController alloc]init];
home = [[BaseViewController alloc] init];
monents = [[BaseViewController alloc] init];