消息列表-发现萌新位置调整

This commit is contained in:
chenguilong
2022-11-18 19:12:35 +08:00
committed by fengshuo
parent a994594617
commit 922100f946
8 changed files with 83 additions and 202 deletions

View File

@@ -962,7 +962,6 @@
E8A1F7A2290689170099C952 /* XPNobleRankTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A1290689170099C952 /* XPNobleRankTableViewCell.m */; }; E8A1F7A2290689170099C952 /* XPNobleRankTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A1290689170099C952 /* XPNobleRankTableViewCell.m */; };
E8A1F7A529068F500099C952 /* XPNobleMyInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */; }; E8A1F7A529068F500099C952 /* XPNobleMyInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */; };
E8A1F7A8290690E00099C952 /* XPNobleRankUpdateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */; }; E8A1F7A8290690E00099C952 /* XPNobleRankUpdateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */; };
E8A30BDA28533E59003B4873 /* SessionDiscoverNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BD928533E59003B4873 /* SessionDiscoverNewTableViewCell.m */; };
E8A30BE328534A28003B4873 /* XPSessionFindNewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BE228534A28003B4873 /* XPSessionFindNewViewController.m */; }; E8A30BE328534A28003B4873 /* XPSessionFindNewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BE228534A28003B4873 /* XPSessionFindNewViewController.m */; };
E8A30BE828534A63003B4873 /* XPSessionFindNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BE728534A63003B4873 /* XPSessionFindNewTableViewCell.m */; }; E8A30BE828534A63003B4873 /* XPSessionFindNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BE728534A63003B4873 /* XPSessionFindNewTableViewCell.m */; };
E8A30BEB28534A96003B4873 /* XPSessionFindNewFiltrateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BEA28534A96003B4873 /* XPSessionFindNewFiltrateView.m */; }; E8A30BEB28534A96003B4873 /* XPSessionFindNewFiltrateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BEA28534A96003B4873 /* XPSessionFindNewFiltrateView.m */; };
@@ -3000,8 +2999,6 @@
E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleMyInfoView.m; sourceTree = "<group>"; }; E8A1F7A429068F500099C952 /* XPNobleMyInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleMyInfoView.m; sourceTree = "<group>"; };
E8A1F7A6290690E00099C952 /* XPNobleRankUpdateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleRankUpdateView.h; sourceTree = "<group>"; }; E8A1F7A6290690E00099C952 /* XPNobleRankUpdateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleRankUpdateView.h; sourceTree = "<group>"; };
E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleRankUpdateView.m; sourceTree = "<group>"; }; E8A1F7A7290690E00099C952 /* XPNobleRankUpdateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleRankUpdateView.m; sourceTree = "<group>"; };
E8A30BD828533E59003B4873 /* SessionDiscoverNewTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionDiscoverNewTableViewCell.h; sourceTree = "<group>"; };
E8A30BD928533E59003B4873 /* SessionDiscoverNewTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionDiscoverNewTableViewCell.m; sourceTree = "<group>"; };
E8A30BE128534A28003B4873 /* XPSessionFindNewViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewViewController.h; sourceTree = "<group>"; }; E8A30BE128534A28003B4873 /* XPSessionFindNewViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewViewController.h; sourceTree = "<group>"; };
E8A30BE228534A28003B4873 /* XPSessionFindNewViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionFindNewViewController.m; sourceTree = "<group>"; }; E8A30BE228534A28003B4873 /* XPSessionFindNewViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionFindNewViewController.m; sourceTree = "<group>"; };
E8A30BE628534A63003B4873 /* XPSessionFindNewTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewTableViewCell.h; sourceTree = "<group>"; }; E8A30BE628534A63003B4873 /* XPSessionFindNewTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewTableViewCell.h; sourceTree = "<group>"; };
@@ -4155,8 +4152,6 @@
18A61BE7274F9CF000A09A54 /* SessionListViewController.m */, 18A61BE7274F9CF000A09A54 /* SessionListViewController.m */,
18EE3FDD2750C1F700A452BF /* SessionListCell.h */, 18EE3FDD2750C1F700A452BF /* SessionListCell.h */,
18EE3FDE2750C1F700A452BF /* SessionListCell.m */, 18EE3FDE2750C1F700A452BF /* SessionListCell.m */,
E8A30BD828533E59003B4873 /* SessionDiscoverNewTableViewCell.h */,
E8A30BD928533E59003B4873 /* SessionDiscoverNewTableViewCell.m */,
); );
path = SessionList; path = SessionList;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -9724,7 +9719,6 @@
E824544326F58FCE00BE8163 /* XPMinePayPwdInputView.m in Sources */, E824544326F58FCE00BE8163 /* XPMinePayPwdInputView.m in Sources */,
9B1B72A1280023F3003FACE9 /* XPMineAnchorFansTeamTableViewCell.m in Sources */, 9B1B72A1280023F3003FACE9 /* XPMineAnchorFansTeamTableViewCell.m in Sources */,
1808073027315E8E001FD836 /* NetImageView.m in Sources */, 1808073027315E8E001FD836 /* NetImageView.m in Sources */,
E8A30BDA28533E59003B4873 /* SessionDiscoverNewTableViewCell.m in Sources */,
E8834E562800585A0029CCC1 /* XPGuildManagerPerPresenter.m in Sources */, E8834E562800585A0029CCC1 /* XPGuildManagerPerPresenter.m in Sources */,
E880B3AC278BD98600A83B0D /* XPAcrossRoomPKEmptyTableViewCell.m in Sources */, E880B3AC278BD98600A83B0D /* XPAcrossRoomPKEmptyTableViewCell.m in Sources */,
18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */, 18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */,

View File

@@ -1,18 +0,0 @@
//
// SessionDiscoverNewTableViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2022/6/10.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SessionDiscoverNewTableViewCell : UITableViewCell
///是否隐藏小红点
@property (nonatomic,assign) BOOL hiddenDotView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,139 +0,0 @@
//
// SessionDiscoverNewTableViewCell.m
// xplan-ios
//
// Created by on 2022/6/10.
//
#import "SessionDiscoverNewTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
@interface SessionDiscoverNewTableViewCell ()
///logo
@property (nonatomic,strong) NetImageView *logoImageView;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UIImageView *arrowImageView;
///线
@property (nonatomic,strong) UIView * lineView;
///
@property (nonatomic,strong) UIView * dotView;
@end
@implementation SessionDiscoverNewTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.logoImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.arrowImageView];
[self.contentView addSubview:self.lineView];
[self.contentView addSubview:self.dotView];
}
- (void)initSubViewConstraints {
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.height.width.mas_equalTo(45);
make.centerY.mas_equalTo(self.contentView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.logoImageView.mas_centerY);
make.left.mas_equalTo(self.logoImageView.mas_right).offset(15);
}];
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(6.5, 11));
make.right.mas_equalTo(self.contentView).offset(-15);
make.centerY.mas_equalTo(self.contentView);
}];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.offset(-15);
make.left.mas_equalTo(self.titleLabel);
make.bottom.mas_equalTo(self);
make.height.mas_equalTo(0.5f);
}];
[self.dotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(8, 8));
make.centerY.mas_equalTo(self.contentView);
make.right.mas_equalTo(self.arrowImageView.mas_left).offset(-3);
}];
}
#pragma mark - Getters And Setters
- (void)setHiddenDotView:(BOOL)hiddenDotView {
_hiddenDotView = hiddenDotView;
self.dotView.hidden = _hiddenDotView;
}
- (NetImageView *)logoImageView {
if (!_logoImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_logoImageView = [[NetImageView alloc] initWithConfig:config];
_logoImageView.layer.masksToBounds = YES;
_logoImageView.layer.cornerRadius = 45 / 2;
_logoImageView.imageUrl = @"https://image.lecheng163.com/fxmx.png";
}
return _logoImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_titleLabel.backgroundColor = [UIColor clearColor];
_titleLabel.font = [UIFont systemFontOfSize:15.f weight:UIFontWeightMedium];
_titleLabel.textColor = ThemeColor.mainTextColor;
_titleLabel.text = @"发现萌新";
}
return _titleLabel;
}
- (UIImageView *)arrowImageView {
if (!_arrowImageView) {
_arrowImageView = [[UIImageView alloc] init];
_arrowImageView.userInteractionEnabled = YES;
_arrowImageView.image = [UIImage imageNamed:@"common_right_arrow"];
}
return _arrowImageView;
}
- (UIView *)lineView {
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.backgroundColor = [ThemeColor dividerColor];
}
return _lineView;
}
- (UIView *)dotView {
if (!_dotView) {
_dotView = [[UIView alloc] init];
_dotView.backgroundColor = [UIColor redColor];
_dotView.layer.cornerRadius = 4;
_dotView.layer.masksToBounds = YES;
}
return _dotView;
}
@end

View File

@@ -7,11 +7,9 @@
#import "SessionListViewController.h" #import "SessionListViewController.h"
#import "SessionListCell.h" #import "SessionListCell.h"
#import "SessionDiscoverNewTableViewCell.h"
#import "SessionViewController.h" #import "SessionViewController.h"
#import "ThemeColor.h" #import "ThemeColor.h"
#import "XPMacro.h" #import "XPMacro.h"
#import "ClientConfig.h"
#import "Api+Mine.h" #import "Api+Mine.h"
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "NSArray+Safe.h" #import "NSArray+Safe.h"
@@ -27,7 +25,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
@interface SessionListViewController ()<UITableViewDataSource, UITableViewDelegate, NIMLoginManagerDelegate, NIMConversationManagerDelegate> @interface SessionListViewController ()<UITableViewDataSource, UITableViewDelegate, NIMLoginManagerDelegate, NIMConversationManagerDelegate, XPSessionListHeadViewDelegate>
@property (nonatomic,strong) UIView *customNavigationBar; @property (nonatomic,strong) UIView *customNavigationBar;
@@ -189,15 +187,6 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
#pragma mark - UITableViewDelegate #pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
SessionDiscoverNewTableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
cell.hiddenDotView = YES;
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kMessageShowReadDotKey];
XPSessionFindNewViewController * findNewVC = [[XPSessionFindNewViewController alloc] init];
[self.navigationController pushViewController:findNewVC animated:YES];
return;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.openType == SessionListOpenTypeRoom) { if (self.openType == SessionListOpenTypeRoom) {
NIMRecentSession *recentSession = self.recentSessions[indexPath.row]; NIMRecentSession *recentSession = self.recentSessions[indexPath.row];
@@ -224,9 +213,6 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
} }
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return NO;
}
return YES; return YES;
} }
@@ -241,27 +227,11 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
} }
#pragma mark - UITableViewDataSource #pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section == 0) {
return [ClientConfig shareConfig].configInfo.findNewbieCharmLevel <= self.userInfo.userLevelVo.charmLevelSeq ? 1 : 0;
}
return self.recentSessions.count; return self.recentSessions.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
SessionDiscoverNewTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SessionDiscoverNewTableViewCell class])];
if (cell == nil) {
cell = [[SessionDiscoverNewTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([SessionDiscoverNewTableViewCell class])];
}
BOOL hidden = [[NSUserDefaults standardUserDefaults] boolForKey:kMessageShowReadDotKey];
cell.hiddenDotView = hidden;
return cell;
}
static NSString * cellId = @"cellId"; static NSString * cellId = @"cellId";
SessionListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId]; SessionListCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) { if (!cell) {
@@ -337,6 +307,25 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
return self.view; return self.view;
} }
#pragma mark - XPSessionListHeadViewDelegate
///
- (void)XPSessionListHeadViewDidClickOffice {
}
///
- (void)XPSessionListHeadViewDidClickActivity {
}
///
- (void)XPSessionListHeadViewDidClickSubscribe {
}
///
- (void)XPSessionListHeadViewDidClickMengxin {
XPSessionFindNewViewController * findNewVC = [[XPSessionFindNewViewController alloc] init];
[self.navigationController pushViewController:findNewVC animated:YES];
}
#pragma mark - Private #pragma mark - Private
- (NSInteger)findInsertPlace:(NIMRecentSession *)recentSession{ - (NSInteger)findInsertPlace:(NIMRecentSession *)recentSession{
__block NSUInteger matchIdx = 0; __block NSUInteger matchIdx = 0;
@@ -459,6 +448,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (XPSessionListHeadView *)headView { - (XPSessionListHeadView *)headView {
if (!_headView) { if (!_headView) {
_headView = [[XPSessionListHeadView alloc] init]; _headView = [[XPSessionListHeadView alloc] init];
_headView.delegate = self;
} }
return _headView; return _headView;
} }

View File

@@ -8,12 +8,16 @@
#import "XPSessionListHeadItemView.h" #import "XPSessionListHeadItemView.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import "ThemeColor.h" #import "ThemeColor.h"
#import "NIMBadgeView.h"
#import "UIView+NIM.h"
@interface XPSessionListHeadItemView() @interface XPSessionListHeadItemView()
@property (nonatomic, strong) UILabel *nameLabel; @property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UIImageView *imageView; @property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UIView *dotView; @property (nonatomic, strong) UIView *dotView;
///
@property (nonatomic,strong) NIMBadgeView *badgeView;
@end @end
@@ -27,10 +31,17 @@
return self; return self;
} }
- (void)layoutSubviews {
[super layoutSubviews];
self.badgeView.nim_right = self.imageView.nim_right;
self.badgeView.nim_top = self.imageView.nim_top - 6;
}
- (void)initView { - (void)initView {
[self addSubview:self.imageView]; [self addSubview:self.imageView];
[self addSubview:self.nameLabel]; [self addSubview:self.nameLabel];
[self addSubview:self.dotView]; [self addSubview:self.dotView];
[self addSubview:self.badgeView];
} }
- (void)initContraints { - (void)initContraints {
@@ -46,7 +57,7 @@
}]; }];
[self.dotView mas_makeConstraints:^(MASConstraintMaker *make) { [self.dotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.mas_equalTo(self.imageView); make.top.right.mas_equalTo(self.imageView);
make.width.height.mas_equalTo(8); make.width.height.mas_equalTo(12);
}]; }];
} }
@@ -57,6 +68,9 @@
- (void)setImageName:(NSString *)imageName { - (void)setImageName:(NSString *)imageName {
self.imageView.image = [UIImage imageNamed:imageName]; self.imageView.image = [UIImage imageNamed:imageName];
} }
- (void)setShowDot:(BOOL)showDot {
self.dotView.hidden = !showDot;
}
- (UILabel *)nameLabel { - (UILabel *)nameLabel {
if (!_nameLabel) { if (!_nameLabel) {
@@ -78,10 +92,20 @@
- (UIView *)dotView { - (UIView *)dotView {
if (!_dotView) { if (!_dotView) {
_dotView = [[UIView alloc] init]; _dotView = [[UIView alloc] init];
_dotView.layer.cornerRadius = 4; _dotView.layer.cornerRadius = 6;
_dotView.layer.masksToBounds = YES; _dotView.layer.masksToBounds = YES;
_dotView.backgroundColor = UIColorFromRGB(0xFB486A);
_dotView.hidden = YES;
} }
return _dotView; return _dotView;
} }
- (NIMBadgeView *)badgeView {
if (!_badgeView) {
_badgeView = [NIMBadgeView viewWithBadgeTip:@""];
_badgeView.hidden = YES;
}
return _badgeView;
}
@end @end

View File

@@ -9,12 +9,27 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol XPSessionListHeadViewDelegate <NSObject>
///点击官方公告
- (void)XPSessionListHeadViewDidClickOffice;
///点击活动通知
- (void)XPSessionListHeadViewDidClickActivity;
///点击订阅提醒
- (void)XPSessionListHeadViewDidClickSubscribe;
///点击发现萌新
- (void)XPSessionListHeadViewDidClickMengxin;
@end
@interface XPSessionListHeadView : UIView @interface XPSessionListHeadView : UIView
- (void)updateToolViewWithUserLevel:(NSInteger)level; - (void)updateToolViewWithUserLevel:(NSInteger)level;
@property (nonatomic, strong) NSArray *friendsArray; @property (nonatomic, strong) NSArray *friendsArray;
@property (nonatomic, weak) id<XPSessionListHeadViewDelegate> delegate;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -15,6 +15,8 @@
#import "XPSessionListHeadItemView.h" #import "XPSessionListHeadItemView.h"
#import "XPSessionListHeadFriendCell.h" #import "XPSessionListHeadFriendCell.h"
NSString * const kMengXinShowReadDotKey = @"kMengXinShowReadDotKey";
@interface XPSessionListHeadView()<UICollectionViewDelegate, UICollectionViewDataSource> @interface XPSessionListHeadView()<UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) UIStackView *mainStackView; @property (nonatomic, strong) UIStackView *mainStackView;
@@ -133,7 +135,8 @@
XPSessionListHeadItemView *itemView = [[XPSessionListHeadItemView alloc] init]; XPSessionListHeadItemView *itemView = [[XPSessionListHeadItemView alloc] init];
itemView.imageName = mengxinItem.imageName; itemView.imageName = mengxinItem.imageName;
itemView.title = mengxinItem.title; itemView.title = mengxinItem.title;
itemView.showDot = mengxinItem.showRedDot; BOOL hidden = [[NSUserDefaults standardUserDefaults] boolForKey:kMengXinShowReadDotKey];
itemView.showDot = !hidden;
itemView.tag = mengxinItem.type; itemView.tag = mengxinItem.type;
[self.toolStackView addArrangedSubview:itemView]; [self.toolStackView addArrangedSubview:itemView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapItem:)]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapItem:)];
@@ -146,22 +149,34 @@
switch (view.tag) { switch (view.tag) {
case XPSessionListHeadItemType_Office: case XPSessionListHeadItemType_Office:
{ {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPSessionListHeadViewDidClickOffice)]) {
[self.delegate XPSessionListHeadViewDidClickOffice];
}
} }
break; break;
case XPSessionListHeadItemType_Activity: case XPSessionListHeadItemType_Activity:
{ {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPSessionListHeadViewDidClickActivity)]) {
[self.delegate XPSessionListHeadViewDidClickActivity];
}
} }
break; break;
case XPSessionListHeadItemType_Subscribe: case XPSessionListHeadItemType_Subscribe:
{ {
if (self.delegate && [self.delegate respondsToSelector:@selector(XPSessionListHeadViewDidClickSubscribe)]) {
[self.delegate XPSessionListHeadViewDidClickSubscribe];
}
} }
break; break;
case XPSessionListHeadItemType_MemgXin: case XPSessionListHeadItemType_MemgXin:
{ {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kMengXinShowReadDotKey];
[[NSUserDefaults standardUserDefaults] synchronize];
XPSessionListHeadItemView *itemView = [self.toolStackView.subviews lastObject];
itemView.showDot = NO;
if (self.delegate && [self.delegate respondsToSelector:@selector(XPSessionListHeadViewDidClickMengxin)]) {
[self.delegate XPSessionListHeadViewDidClickMengxin];
}
} }
break; break;
default: default:

View File

@@ -294,7 +294,7 @@
_attentionButton.titleLabel.font = [UIFont systemFontOfSize:12]; _attentionButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; [_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
[_attentionButton setTitle:@"互相关注" forState:UIControlStateDisabled]; [_attentionButton setTitle:@"互相关注" forState:UIControlStateDisabled];
[_attentionButton setTitleColor:[ThemeColor disableButtonTextColor] forState:UIControlStateNormal]; [_attentionButton setTitleColor:[ThemeColor disableButtonTextColor] forState:UIControlStateDisabled];
[_attentionButton setBackgroundImage:[UIImage imageWithColor:[ThemeColor disableButtonColor]] forState:UIControlStateDisabled]; [_attentionButton setBackgroundImage:[UIImage imageWithColor:[ThemeColor disableButtonColor]] forState:UIControlStateDisabled];
_attentionButton.layer.masksToBounds = YES; _attentionButton.layer.masksToBounds = YES;
_attentionButton.layer.cornerRadius = 15; _attentionButton.layer.cornerRadius = 15;