去掉赛事tab,增加直播tab

This commit is contained in:
chenguilong
2022-07-27 17:12:06 +08:00
parent 4c7d635719
commit 8209c58772
10 changed files with 89 additions and 34 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tab_live_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tab_live_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tab_live_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tab_live_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -38,14 +38,14 @@
#import "XPHomeLivePresenter.h"
#import "XPHomeLiveProtocol.h"
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
@interface XPHomeLivesViewController ()<JXCategoryViewDelegate, JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate, XPHomeLiveProtocol, XPHomeLiveHeadViewDelegate>
{
NSTimer * timer;
}
@property (nonatomic,strong) UIView *customNavigationBar;
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic, strong) NSArray<NSString *> *titles;
@property (nonatomic, strong) JXPagerView *pagingView;
@@ -77,11 +77,12 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self addTimer];
self.view.backgroundColor = [ThemeColor appBackgroundColor];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.pagingView.frame = self.view.bounds;
self.pagingView.frame = CGRectMake(0, kNavigationHeight, KScreenWidth, KScreenHeight - kNavigationHeight);
}
- (void)viewWillAppear:(BOOL)animated {
@@ -123,7 +124,12 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.customNavigationBar addSubview:self.titleLabel];
[self.view addSubview:self.customNavigationBar];
[self.view addSubview:self.pagingView];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.customNavigationBar);
}];
}
#pragma mark - XPHomeRecommendProtocol
@@ -267,4 +273,23 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
return _headerView;
}
- (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;
}
@end

View File

@@ -148,11 +148,6 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
index = idx;
*stop = YES;
}
} else if ([[dic objectForKey:@"section"] integerValue] == 3) {
if ([obj.name containsString:@"个播"]) {
index = idx;
*stop = YES;
}
}
}];
[self.titleView selectItemAtIndex:index];

View File

@@ -28,7 +28,6 @@
#import "XPHomeHotRoomViewController.h"
#import "XPRoomViewController.h"
#import "XPLittleGameRoomOpenView.h"
#import "XPHomeLivesViewController.h"
UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
@@ -43,8 +42,6 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
@property (nonatomic,assign) NSInteger defaultSelectedIndex;
@property (nonatomic,strong) XPHomeRecommendViewController *recommendVC;
@property (nonatomic,strong) XPHomePartyContainerViewController *partyVC;
///
@property (nonatomic, strong) XPHomeLivesViewController *anchorRoomListVC;
@end
@@ -100,8 +97,6 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
return self.recommendVC;
}else if (index == 1) {
return self.partyVC;
} else if(index == 2) {
return self.anchorRoomListVC;
}
return nil;
}
@@ -183,7 +178,7 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
- (NSArray<NSString *> *)titles {
if (!_titles) {
_titles = @[@"推荐",@"派对", @"直播"];
_titles = @[@"推荐",@"派对"];
}
return _titles;
}
@@ -203,19 +198,4 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
return _partyVC;
}
//- (XPHomePartyViewController *)anchorRoomListVC {
// if (!_anchorRoomListVC) {
// _anchorRoomListVC = [[XPHomePartyViewController alloc] init];
// _anchorRoomListVC.isAnchor = YES;
// }
// return _anchorRoomListVC;
//}
- (XPHomeLivesViewController *)anchorRoomListVC {
if (!_anchorRoomListVC) {
_anchorRoomListVC = [[XPHomeLivesViewController alloc] init];
}
return _anchorRoomListVC;
}
@end

View File

@@ -23,6 +23,7 @@
#import "RtcManager.h"
#import "XCCurrentVCStackManager.h"
#import "Api+Home.h"
#import "XPConstant.h"
///Model
#import "AccountModel.h"
#import "RoomInfoModel.h"
@@ -49,6 +50,7 @@
#import "XPNobleUpgradeLevelView.h"
#import "XPNewUserGreetRoomAlertView.h"
#import "XPSessionFindNewAlertView.h"
#import "XPHomeLivesViewController.h"
///Present
#import "MainPresenter.h"
#import "MainProtocol.h"
@@ -56,6 +58,7 @@
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMChatManagerDelegate>
@@ -85,6 +88,7 @@ NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
[[NSNotificationCenter defaultCenter] addObserverForName:kUserCompleteInfoFinishKey object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
[self completeUserInfoFinish:note.object];
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(recommendMoreNotification:) name:kHomeMoreScrollPageKey object:nil];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -293,9 +297,9 @@ NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
- (void)initTabs:(BOOL)logined {
self.viewControllers = nil;
NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_game_normal",@"tab_message_normal", @"tab_mine_normal"];
NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_game_selected",@"tab_message_selected", @"tab_mine_selected"];
NSArray *tabLabel = @[@"派对",@"赛事",@"消息", @"我的"];
NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_live_normal",@"tab_message_normal", @"tab_mine_normal"];
NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_live_selected",@"tab_message_selected", @"tab_mine_selected"];
NSArray *tabLabel = @[@"派对",@"直播",@"消息", @"我的"];
UIViewController *game;
UIViewController *msg;
@@ -308,7 +312,7 @@ NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
#else
[fvcGame setName:@"/" uniqueId:nil params:nil];
#endif
game = fvcGame;
game = [[XPHomeLivesViewController alloc] init];
msg = [[SessionListViewController alloc] init];
me = [[XPMineViewController alloc] init];
@@ -425,6 +429,13 @@ NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
[TTPopup popupView:view style:TTPopupStyleAlert];
}
#pragma mark - Event Response
- (void)recommendMoreNotification:(NSNotification *)notification {
if ([notification.object[@"section"] intValue] == 3) {
self.selectedIndex = 1;
}
}
#pragma mark - Getters And Setters
- (XPMiniRoomView *)roomMineView {
if (!_roomMineView) {