#import "YOUPAILZLiveAnchorHotWindow.h" #import "JXCategoryView.h" #import "YOUPAIJXCategoryTitleBackgroundView.h" #import "JXCategoryListContainerView.h" #import "YOUPAILZLiveAnchorHotListVC.h" @interface YOUPAILZLiveAnchorHotWindow () @end @implementation YOUPAILZLiveAnchorHotWindow - (void)viewDidLoad { [super viewDidLoad]; self.baseView.hidden = YES; [self youpaifinitUI]; } - (void)youpaifinitUI{ UIImageView *youpaipbgImgV = [[UIImageView alloc] initWithImage:[LCTools ColorImage:CGSizeMake(KScreenWidth, KScreenHeight * 0.6f) FromColors:@[HexColorFromRGB(0xF775BD),HexColorFromRGB(0xF43333)] ByGradientType:GradientTopToBottom]]; youpaipbgImgV.frame = CGRectMake(0.0f, 0.0f, KScreenWidth, KScreenHeight * 0.6f); youpaipbgImgV.userInteractionEnabled = YES; [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:youpaipbgImgV size:CGSizeMake(20.0f, 20.0f)]; [self.view addSubview:youpaipbgImgV]; [youpaipbgImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.offset(0.0f); make.bottom.offset(1.5f); make.height.offset(KScreenHeight * 0.6f); }]; // vqu_images_L_live_anchor_hot UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(1.5f, 1.5f, KScreenWidth - 3.0f, KScreenHeight * 0.6f - 3.0f)]; bgV.backgroundColor = LCBkgColor; [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)]; [youpaipbgImgV addSubview:bgV]; [bgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(1.5f); make.top.offset(1.5f); make.right.offset(-1.5f); make.bottom.offset(0.0f); }]; UIImageView *hotImageView = [UIImageView new]; [self.view addSubview:hotImageView]; [hotImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(0); make.top.mas_equalTo(youpaipbgImgV.mas_top).offset(-30); make.size.mas_equalTo(CGSizeMake(190, 57)); }]; hotImageView.image = [UIImage imageNamed:@"vqu_images_L_live_anchor_hot"]; YOUPAIJXCategoryTitleBackgroundView *youpaipcategoryView = [[YOUPAIJXCategoryTitleBackgroundView alloc] init]; youpaipcategoryView.backgroundColor = HexColorFromRGB(0xFF9494); youpaipcategoryView.titles = self.titles; youpaipcategoryView.delegate = self; youpaipcategoryView.titleSelectedColor = HexColorFromRGB(0xffffff); youpaipcategoryView.titleColor = HexColorFromRGB(0xFF9494); youpaipcategoryView.titleColorGradientEnabled = YES; youpaipcategoryView.titleFont = LCFont(14.0f); youpaipcategoryView.titleSelectedFont = LCFont(14.0f); youpaipcategoryView.cellWidth = 82.0f; youpaipcategoryView.cellSpacing = 1.0f; youpaipcategoryView.averageCellSpacingEnabled = NO; youpaipcategoryView.normalBackgroundColor = LCBkgColor; youpaipcategoryView.selectedBackgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(82.0f, 27.0f) FromColors:@[HexColorFromRGB(0xF775BD),HexColorFromRGB(0xF43333)] ByGradientType:GradientTopToBottom]]; youpaipcategoryView.cellWidthIncrement = 0; youpaipcategoryView.normalBorderColor = [UIColor clearColor]; youpaipcategoryView.selectedBorderColor = [UIColor clearColor]; youpaipcategoryView.borderLineWidth = 0; youpaipcategoryView.backgroundCornerRadius = 0.0f; youpaipcategoryView.backgroundWidth = JXCategoryViewAutomaticDimension; youpaipcategoryView.backgroundHeight = 27.0f; youpaipcategoryView.layer.cornerRadius = 27/2.f; youpaipcategoryView.clipsToBounds = YES; youpaipcategoryView.layer.borderColor = HexColorFromRGB(0xFF9494).CGColor; youpaipcategoryView.layer.borderWidth = 1.0f; [bgV addSubview:youpaipcategoryView]; JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self]; pagerView.listCellBackgroundColor = LCBkgColor; [bgV addSubview:pagerView]; youpaipcategoryView.listContainer = pagerView; [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgV.mas_centerX); make.top.offset(26.0f); make.size.mas_offset(CGSizeMake(250.0f, 27.0f)); }]; [pagerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.offset(0.0f); make.top.equalTo(youpaipcategoryView.mas_bottom).offset(14.0f); }]; } - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ return self.titles.count; } - (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ if (index == 0) { YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init]; vc.youpaiplive_id = self.youpaiplive_id; vc.youpaiptype = LZLiveAnchorHotListType_day; vc.selectedMemberBlock = self.selectedMemberBlock; return vc; }else if(index == 1) { YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init]; vc.youpaiplive_id = self.youpaiplive_id; vc.youpaiptype = LZLiveAnchorHotListType_week; vc.selectedMemberBlock = self.selectedMemberBlock; return vc; }else{ YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init]; vc.youpaiplive_id = self.youpaiplive_id; vc.youpaiptype = LZLiveAnchorHotListType_month; vc.selectedMemberBlock = self.selectedMemberBlock; return vc; } } - (NSArray *)titles{ return @[@"日榜",@"周榜",@"月榜"]; } @end