重构了表情的View

This commit is contained in:
fengshuo
2022-03-10 16:18:26 +08:00
parent 6a6dd65cb0
commit 96e99e9dc8
76 changed files with 1661 additions and 3954 deletions

View File

@@ -24,12 +24,14 @@
///View
#import "XPRoomSendTextView.h"
#import "XPSendGiftView.h"
#import "XPRoomFaceView.h"
#import "SessionListViewController.h"
#import "XPRoomMoreMenuViewController.h"
#import "XPNobleCenterViewController.h"
#import "XPRoomFaceViewController.h"
@interface XPRoomMenuContainerView ()
///
@property (nonatomic,strong) UIScrollView *scrollView;
///
@property (nonatomic,strong) UIStackView *stackView;
///
@@ -50,8 +52,6 @@
@property (nonatomic,strong) UIButton *arrangeMicButton;
///
@property (nonatomic,strong) UIButton *nobleButton;
///
@property (nonatomic,strong) UIView * placeHolderView;
///
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
@end
@@ -95,10 +95,10 @@
break;
case XPRoomMenuItemType_Face: {
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
XPRoomFaceView * faceView = [[XPRoomFaceView alloc] initWithRoomUid:roomUid];
faceView.delegate = self.delegate;
[TTPopup popupView:faceView style:TTPopupStyleActionSheet];
XPRoomFaceViewController * faceVC = [[XPRoomFaceViewController alloc] init];
faceVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
faceVC.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
[self.delegate.getCurrentNav presentViewController:faceVC animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_Gift: {
@@ -158,7 +158,11 @@
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];
[self addSubview:self.scrollView];
[self addSubview:self.giftButton];
[self.scrollView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.inputButton];
[self.stackView addArrangedSubview:self.micButton];
[self.stackView addArrangedSubview:self.voiceButton];
@@ -167,21 +171,26 @@
[self.stackView addArrangedSubview:self.messageButton];
[self.stackView addArrangedSubview:self.moreButton];
[self.stackView addArrangedSubview:self.nobleButton];
[self.stackView addArrangedSubview:self.placeHolderView];
[self.stackView addArrangedSubview:self.giftButton];
}
- (void)initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self).inset(15);
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.right.mas_equalTo(self.giftButton.mas_left).offset(-10);
make.top.bottom.mas_equalTo(self);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
}];
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(100, 30));
}];
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.right.mas_equalTo(self).offset(-15);
make.size.mas_equalTo(CGSizeMake(38, 38));
}];
}
@@ -440,15 +449,6 @@
return _giftButton;
}
- (UIView *)placeHolderView {
if (!_placeHolderView) {
_placeHolderView = [[UIView alloc] init];
_placeHolderView.backgroundColor = [UIColor clearColor];
[_placeHolderView setContentHuggingPriority:UILayoutPriorityDragThatCanResizeScene forAxis:UILayoutConstraintAxisHorizontal];
}
return _placeHolderView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
@@ -472,4 +472,13 @@
return _arrangeMicButton;
}
- (UIScrollView *)scrollView {
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] init];
_scrollView.backgroundColor = [UIColor clearColor];
_scrollView.showsHorizontalScrollIndicator = NO;
}
return _scrollView;
}
@end