折叠房间分享按钮

This commit is contained in:
chenguilong
2022-09-30 17:29:27 +08:00
parent 4be9c07a82
commit 5a06c9842a
8 changed files with 176 additions and 179 deletions

View File

@@ -251,6 +251,7 @@
9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; }; 9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; };
9BAC92EE28E6989400147DD8 /* XPRoomActivityPlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */; }; 9BAC92EE28E6989400147DD8 /* XPRoomActivityPlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */; };
9BAC92F228E6A05600147DD8 /* XPRoomActivityPlayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */; }; 9BAC92F228E6A05600147DD8 /* XPRoomActivityPlayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */; };
9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */; };
9BAD41AC28C6EB13005E47B3 /* XPInRoomRecordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */; }; 9BAD41AC28C6EB13005E47B3 /* XPInRoomRecordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */; };
9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; }; 9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; };
9BB5495C2782E79E0090CD26 /* NobleCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB5495B2782E79E0090CD26 /* NobleCenterModel.m */; }; 9BB5495C2782E79E0090CD26 /* NobleCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB5495B2782E79E0090CD26 /* NobleCenterModel.m */; };
@@ -1673,6 +1674,8 @@
9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayView.m; sourceTree = "<group>"; }; 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayView.m; sourceTree = "<group>"; };
9BAC92F028E6A05600147DD8 /* XPRoomActivityPlayModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomActivityPlayModel.h; sourceTree = "<group>"; }; 9BAC92F028E6A05600147DD8 /* XPRoomActivityPlayModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomActivityPlayModel.h; sourceTree = "<group>"; };
9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayModel.m; sourceTree = "<group>"; }; 9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayModel.m; sourceTree = "<group>"; };
9BAC92F328E6E63000147DD8 /* XPRoomInsideOperationCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomInsideOperationCell.h; sourceTree = "<group>"; };
9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomInsideOperationCell.m; sourceTree = "<group>"; };
9BAD41AA28C6EB13005E47B3 /* XPInRoomRecordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordPresenter.h; sourceTree = "<group>"; }; 9BAD41AA28C6EB13005E47B3 /* XPInRoomRecordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordPresenter.h; sourceTree = "<group>"; };
9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPInRoomRecordPresenter.m; sourceTree = "<group>"; }; 9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPInRoomRecordPresenter.m; sourceTree = "<group>"; };
9BAD41AD28C6ECBA005E47B3 /* XPInRoomRecordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordProtocol.h; sourceTree = "<group>"; }; 9BAD41AD28C6ECBA005E47B3 /* XPInRoomRecordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordProtocol.h; sourceTree = "<group>"; };
@@ -4339,6 +4342,8 @@
9B6E8572281AB9B20041A321 /* XPRoomInsideRecommendCell.m */, 9B6E8572281AB9B20041A321 /* XPRoomInsideRecommendCell.m */,
9B6E8575281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.h */, 9B6E8575281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.h */,
9B6E8576281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m */, 9B6E8576281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m */,
9BAC92F328E6E63000147DD8 /* XPRoomInsideOperationCell.h */,
9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */,
); );
path = SubViews; path = SubViews;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -9042,6 +9047,7 @@
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */, E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */,
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */, E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */,
E86A16C22856D635004228B8 /* XPSessionFindNewGreetTableViewCell.m in Sources */, E86A16C22856D635004228B8 /* XPSessionFindNewGreetTableViewCell.m in Sources */,
E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */, E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */,
E86E79CD28A4E045006DAF48 /* MessageContentRiskAlertView.m in Sources */, E86E79CD28A4E045006DAF48 /* MessageContentRiskAlertView.m in Sources */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -62,8 +62,6 @@
@property (nonatomic,strong) YYLabel *idLabel; @property (nonatomic,strong) YYLabel *idLabel;
/// ///
@property (nonatomic,strong) UIButton *collectButton; @property (nonatomic,strong) UIButton *collectButton;
///
@property (nonatomic,strong) UIButton *shareButton;
/// ///
@property (nonatomic,strong) UIButton *settingButton; @property (nonatomic,strong) UIButton *settingButton;
@property (nonatomic, weak) id<RoomHostDelegate> hostDelegate; @property (nonatomic, weak) id<RoomHostDelegate> hostDelegate;
@@ -127,7 +125,6 @@
[self addSubview:self.backButton]; [self addSubview:self.backButton];
[self addSubview:self.nickStackView]; [self addSubview:self.nickStackView];
[self addSubview:self.collectButton]; [self addSubview:self.collectButton];
[self addSubview:self.shareButton];
[self addSubview:self.settingButton]; [self addSubview:self.settingButton];
[self.nickStackView addArrangedSubview:self.titleStackView]; [self.nickStackView addArrangedSubview:self.titleStackView];
@@ -153,16 +150,10 @@
make.bottom.mas_equalTo(-11); make.bottom.mas_equalTo(-11);
make.width.height.mas_equalTo(22); make.width.height.mas_equalTo(22);
}]; }];
[self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.settingButton.mas_left).offset(-8);
make.centerY.mas_equalTo(self.settingButton);
make.width.height.mas_equalTo(22);
}];
[self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.settingButton); make.centerY.equalTo(self.settingButton);
make.right.equalTo(self.shareButton.mas_left).offset(-8); make.right.equalTo(self.settingButton.mas_left).offset(-8);
make.width.height.mas_equalTo(22); make.width.height.mas_equalTo(22);
}]; }];
@@ -367,6 +358,11 @@
[self.hostDelegate exitRoom]; [self.hostDelegate exitRoom];
} }
- (void)xPRoomRecommendViewShare {
[FFPopup dismissPopupForView:self.recommendRoomView animated:NO];
[self showSharePanel];
}
- (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid { - (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid {
[FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; [FFPopup dismissPopupForView:self.recommendRoomView animated:NO];
[self.hostDelegate exitRoom]; [self.hostDelegate exitRoom];
@@ -386,16 +382,6 @@
return _backButton; return _backButton;
} }
- (UIButton *)shareButton {
if(!_shareButton){
_shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_shareButton setImage:[UIImage imageNamed:@"room_info_share"] forState:UIControlStateNormal];
[_shareButton addTarget:self action:@selector(shareButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_shareButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8];
}
return _shareButton;
}
- (UIButton *)settingButton { - (UIButton *)settingButton {
if (!_settingButton) { if (!_settingButton) {
_settingButton = [UIButton buttonWithType:UIButtonTypeCustom]; _settingButton = [UIButton buttonWithType:UIButtonTypeCustom];

View File

@@ -0,0 +1,19 @@
//
// XPRoomInsideOperationCell.h
// xplan-ios
//
// Created by GreenLand on 2022/9/30.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomInsideOperationCell : UICollectionViewCell
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *imageName;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,70 @@
//
// XPRoomInsideOperationCell.m
// xplan-ios
//
// Created by GreenLand on 2022/9/30.
//
#import "XPRoomInsideOperationCell.h"
///Third
#import <Masonry/Masonry.h>
@interface XPRoomInsideOperationCell()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation XPRoomInsideOperationCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self initContraints];
}
return self;
}
- (void)initView {
[self addSubview:self.imageView];
[self addSubview:self.titleLabel];
}
- (void)initContraints {
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.mas_equalTo(self);
make.width.height.mas_equalTo(52);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(4);
make.centerX.mas_equalTo(self);
make.height.mas_equalTo(12);
}];
}
- (void)setTitle:(NSString *)title {
self.titleLabel.text = title;
}
- (void)setImageName:(NSString *)imageName {
self.imageView.image = [UIImage imageNamed:imageName];
}
- (UIImageView *)imageView {
if (!_imageView) {
_imageView = [[UIImageView alloc] init];
}
return _imageView;
}
- (UILabel *)titleLabel{
if (!_titleLabel) {
UILabel *label = [[UILabel alloc] init];
label.font = [UIFont systemFontOfSize:10];
label.textColor = [UIColor whiteColor];
_titleLabel = label;
}
return _titleLabel;
}
@end

View File

@@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)xPRoomRecommendViewMiniRoom; - (void)xPRoomRecommendViewMiniRoom;
///退出房间 ///退出房间
- (void)xPRoomRecommendViewExitRoom; - (void)xPRoomRecommendViewExitRoom;
///分享
- (void)xPRoomRecommendViewShare;
///跳转到房间 ///跳转到房间
- (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid; - (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid;

View File

@@ -14,28 +14,17 @@
///View ///View
#import "XPRoomInsideRecommendCell.h" #import "XPRoomInsideRecommendCell.h"
#import "XPRoomInsideRecommendEmptyCell.h" #import "XPRoomInsideRecommendEmptyCell.h"
#import "XPRoomInsideOperationCell.h"
@interface XPRoomRecommendView ()<UITableViewDelegate, UITableViewDataSource> @interface XPRoomRecommendView ()<UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource>
/// ///
@property (nonatomic, strong) UIToolbar *toolBar; @property (nonatomic, strong) UIToolbar *toolBar;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIStackView *reportStackView; @property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) UIStackView *miniStackView; @property (nonatomic, strong) NSMutableArray *titleArray;
@property (nonatomic, strong) UIStackView *exitStackView; @property (nonatomic, strong) NSMutableArray *imageArray;
///
@property (nonatomic,strong) UIButton *reportButton;
///
@property (nonatomic,strong) UIButton *miniButton;
///退
@property (nonatomic,strong) UIButton *exitButton;
///
@property (nonatomic,strong) UILabel *reportLabel;
///
@property (nonatomic,strong) UILabel *miniLabel;
///退
@property (nonatomic,strong) UILabel *exitLabel;
/// ///
@property (nonatomic, strong) UILabel *recommentLabel; @property (nonatomic, strong) UILabel *recommentLabel;
@@ -54,15 +43,7 @@
#pragma mark - lifeCycle #pragma mark - lifeCycle
- (void)setUpUI { - (void)setUpUI {
[self addSubview:self.toolBar]; [self addSubview:self.toolBar];
[self addSubview:self.reportStackView]; [self addSubview:self.collectionView];
[self addSubview:self.miniStackView];
[self addSubview:self.exitStackView];
[self.reportStackView addArrangedSubview:self.reportButton];
[self.reportStackView addArrangedSubview:self.reportLabel];
[self.miniStackView addArrangedSubview:self.miniButton];
[self.miniStackView addArrangedSubview:self.miniLabel];
[self.exitStackView addArrangedSubview:self.exitButton];
[self.exitStackView addArrangedSubview:self.exitLabel];
[self addSubview:self.recommentLabel]; [self addSubview:self.recommentLabel];
[self addSubview:self.tableView]; [self addSubview:self.tableView];
} }
@@ -77,30 +58,13 @@
[self.toolBar mas_makeConstraints:^(MASConstraintMaker *make) { [self.toolBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.bottom.mas_equalTo(self); make.top.left.right.bottom.mas_equalTo(self);
}]; }];
[self.reportStackView mas_makeConstraints:^(MASConstraintMaker *make) { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.mas_equalTo(kStatusBarHeight + 8); make.top.mas_equalTo(kStatusBarHeight + 8);
make.left.mas_equalTo(15); make.height.mas_equalTo(82*2);
}];
[self.miniStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight + 8);
make.left.mas_equalTo(self.reportStackView.mas_right).mas_offset(30);
}];
[self.exitStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight + 8);
make.left.mas_equalTo(self.miniStackView.mas_right).mas_offset(30);
}];
[self.reportButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(54);
}];
[self.miniButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(54);
}];
[self.exitButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(54);
}]; }];
[self.recommentLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.recommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.miniStackView.mas_bottom).mas_offset(16); make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(16);
make.left.mas_equalTo(11); make.left.mas_equalTo(11);
}]; }];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -108,6 +72,37 @@
make.top.mas_equalTo(self.recommentLabel.mas_bottom); make.top.mas_equalTo(self.recommentLabel.mas_bottom);
}]; }];
} }
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.titleArray.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPRoomInsideOperationCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class]) forIndexPath:indexPath];
cell.title = self.titleArray[indexPath.row];
cell.imageName = self.imageArray[indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {//
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) {
[self.delegate xPRoomRecommendViewMiniRoom];
}
} else if (indexPath.row == 1) {//
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewShare)]) {
[self.delegate xPRoomRecommendViewShare];
}
} else if (indexPath.row == 2) {//退
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) {
[self.delegate xPRoomRecommendViewExitRoom];
}
} else {//
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) {
[self.delegate xPRoomRecommendViewReport];
}
}
}
#pragma mark - UITableViewDelegate #pragma mark - UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -142,25 +137,6 @@
return self.roomList.count > 0 ? 84 : KScreenHeight - kStatusBarHeight -8 - 120; return self.roomList.count > 0 ? 84 : KScreenHeight - kStatusBarHeight -8 - 120;
} }
#pragma mark - atcion
- (void)reportButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) {
[self.delegate xPRoomRecommendViewReport];
}
}
- (void)miniButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) {
[self.delegate xPRoomRecommendViewMiniRoom];
}
}
- (void)exitButtonAction:(UIButton *)sender{
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) {
[self.delegate xPRoomRecommendViewExitRoom];
}
}
#pragma mark - getter #pragma mark - getter
- (UIToolbar *)toolBar { - (UIToolbar *)toolBar {
if (!_toolBar) { if (!_toolBar) {
@@ -171,99 +147,6 @@
return _toolBar; return _toolBar;
} }
- (UIButton *)miniButton {
if(!_miniButton){
_miniButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_miniButton setImage:[UIImage imageNamed:@"room_info_mini"] forState:UIControlStateNormal];
[_miniButton addTarget:self action:@selector(miniButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_miniButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_miniButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _miniButton;
}
- (UIButton *)exitButton {
if (!_exitButton) {
_exitButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_exitButton setImage:[UIImage imageNamed:@"room_info_exit"] forState:UIControlStateNormal];
[_exitButton addTarget:self action:@selector(exitButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _exitButton;
}
- (UIButton *)reportButton {
if (!_reportButton) {
_reportButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_reportButton setImage:[UIImage imageNamed:@"room_info_report"] forState:UIControlStateNormal];
[_reportButton addTarget:self action:@selector(reportButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _reportButton;
}
- (UIStackView *)reportStackView {
if (!_reportStackView) {
_reportStackView = [[UIStackView alloc] init];
_reportStackView.axis = UILayoutConstraintAxisVertical;
_reportStackView.distribution = UIStackViewDistributionFill;
_reportStackView.alignment = UIStackViewAlignmentCenter;
_reportStackView.spacing = 17;
}
return _reportStackView;
}
- (UIStackView *)miniStackView {
if (!_miniStackView) {
_miniStackView = [[UIStackView alloc] init];
_miniStackView.axis = UILayoutConstraintAxisVertical;
_miniStackView.distribution = UIStackViewDistributionFill;
_miniStackView.alignment = UIStackViewAlignmentCenter;
_miniStackView.spacing = 17;
}
return _miniStackView;
}
- (UIStackView *)exitStackView {
if (!_exitStackView) {
_exitStackView = [[UIStackView alloc] init];
_exitStackView.axis = UILayoutConstraintAxisVertical;
_exitStackView.distribution = UIStackViewDistributionFill;
_exitStackView.alignment = UIStackViewAlignmentCenter;
_exitStackView.spacing = 17;
}
return _exitStackView;
}
- (UILabel *)reportLabel {
if (!_reportLabel) {
_reportLabel = [[UILabel alloc] init];
_reportLabel.text = @"举报房间";
_reportLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_reportLabel.textAlignment = NSTextAlignmentCenter;
_reportLabel.textColor = [UIColor whiteColor];
}
return _reportLabel;
}
- (UILabel *)miniLabel {
if (!_miniLabel) {
_miniLabel = [[UILabel alloc] init];
_miniLabel.text = @"收起房间";
_miniLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_miniLabel.textAlignment = NSTextAlignmentCenter;
_miniLabel.textColor = [UIColor whiteColor];
}
return _miniLabel;
}
- (UILabel *)exitLabel {
if (!_exitLabel) {
_exitLabel = [[UILabel alloc] init];
_exitLabel.text = @"退出房间";
_exitLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_exitLabel.textAlignment = NSTextAlignmentCenter;
_exitLabel.textColor = [UIColor whiteColor];
}
return _exitLabel;
}
- (UILabel *)recommentLabel { - (UILabel *)recommentLabel {
if (!_recommentLabel) { if (!_recommentLabel) {
_recommentLabel = [[UILabel alloc] init]; _recommentLabel = [[UILabel alloc] init];
@@ -288,4 +171,35 @@
return _tableView; return _tableView;
} }
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
layout.minimumLineSpacing = 14;
layout.minimumInteritemSpacing = (250 - 3 * 52) / 4;
layout.itemSize = CGSizeMake(52, 68);
layout.sectionInset = UIEdgeInsetsMake(0, (250 - 3 * 52) / 4, 0, (250 - 3 * 52) / 4);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[_collectionView registerClass:[XPRoomInsideOperationCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class])];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor clearColor];
}
return _collectionView;
}
- (NSMutableArray *)titleArray {
if (!_titleArray) {
_titleArray = [NSMutableArray arrayWithObjects:@"收起房间", @"分享房间", @"退出房间", @"举报房间", nil];
}
return _titleArray;
}
- (NSMutableArray *)imageArray {
if (!_imageArray) {
_imageArray = [NSMutableArray arrayWithObjects:@"room_info_mini", @"room_info_share", @"room_info_exit", @"room_info_report", nil];
}
return _imageArray;
}
@end @end