个播房可以向上滚动
This commit is contained in:
@@ -54,6 +54,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param roomUid 房间的uid
|
||||
- (void)getCycleAnchorRoomList:(NSString *)roomUid;
|
||||
|
||||
///获取当前房间是否有效
|
||||
- (void)getCurrentRoomInfo:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -216,4 +216,13 @@
|
||||
} roomUid:roomUid];
|
||||
}
|
||||
|
||||
- (void)getCurrentRoomInfo:(NSString *)roomUid {
|
||||
[Api getRoomInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] getCurrentRoomInfo:roomInfo];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] getCurrentRoomInfo:nil];
|
||||
}] uid:roomUid intoUid:@""];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -25,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getRoomSuperAdminScuccess:(NSArray *)list;
|
||||
///获取下一个个播房成功
|
||||
- (void)getNextAnchorRoomSuccess:(RoomInfoModel *)roomInfo;
|
||||
|
||||
///获取当前房间的信息
|
||||
- (void)getCurrentRoomInfo:(RoomInfoModel *_Nullable)roomInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -7,11 +7,11 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "NetImageView.h"
|
||||
|
||||
@class AnchorRoomScrollView;
|
||||
|
||||
@protocol AnchorRoomScrollViewDelegate <NSObject>
|
||||
|
||||
///滚动到上一个时回调
|
||||
- (void)anchorScrollViewScrollToPrevious:(AnchorRoomScrollView *)anchorScrollView;
|
||||
///滚动到下一个时回调
|
||||
- (void)anchorScrollViewScrollToNext:(AnchorRoomScrollView *)anchorScrollView;
|
||||
///开始停止
|
||||
@@ -24,7 +24,12 @@
|
||||
@interface AnchorRoomScrollView : UIScrollView
|
||||
|
||||
@property (nonatomic, assign) id<AnchorRoomScrollViewDelegate> anchorScrollDelegate;
|
||||
@property (nonatomic, strong) NetImageView *middleImageView;
|
||||
@property (nonatomic, strong) UIView *middleImageView;
|
||||
@property (nonatomic,assign) BOOL isCanScrollTop;
|
||||
///是不是下一个
|
||||
@property (nonatomic,assign) BOOL isScrollNext;
|
||||
///是不是上一个
|
||||
@property (nonatomic,assign) BOOL isScrollPrevious;
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame;
|
||||
|
||||
|
@@ -9,20 +9,21 @@
|
||||
#import "XPMacro.h"
|
||||
#import "RoomInfoModel.h"
|
||||
//SVGA动画播放
|
||||
#import "SVGA.h"
|
||||
|
||||
#import "SVGAParserManager.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
|
||||
@interface AnchorRoomScrollView()<UIScrollViewDelegate, UIGestureRecognizerDelegate>
|
||||
|
||||
///动态背景
|
||||
@property (nonatomic, strong) SVGAImageView *svgDisplayView;
|
||||
@property (nonatomic, strong) SVGAImageView *middleDisplayView;
|
||||
@property (nonatomic, strong) SVGAParserManager *parserManager;
|
||||
|
||||
@property (nonatomic, strong) NetImageView *downImageView;
|
||||
@property (nonatomic, strong) SVGAImageView *topDisplayView;
|
||||
|
||||
@property (nonatomic, strong) SVGAImageView *downDisplayView;
|
||||
|
||||
@property (nonatomic, assign) BOOL animatePlay;
|
||||
|
||||
@end
|
||||
|
||||
@implementation AnchorRoomScrollView
|
||||
@@ -32,103 +33,124 @@
|
||||
self = [super initWithFrame:frame];
|
||||
if(self)
|
||||
{
|
||||
self.contentSize = CGSizeMake(0, frame.size.height * 2);
|
||||
self.pagingEnabled = YES;
|
||||
self.showsHorizontalScrollIndicator = NO;
|
||||
self.showsVerticalScrollIndicator = NO;
|
||||
self.delegate = self;
|
||||
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
self.alwaysBounceVertical = NO;
|
||||
self.bounces = NO;
|
||||
self.delaysContentTouches = NO;
|
||||
self.scrollsToTop = NO;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(roomMessageTabelViewStopScroll) name:@"roomMessageTabelViewStopScroll" object:nil];
|
||||
self.isCanScrollTop = NO;
|
||||
[self addSubview:self.topDisplayView];
|
||||
[self addSubview:self.middleDisplayView];
|
||||
[self addSubview:self.downDisplayView];
|
||||
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.placeHolder = [UIImage imageNamed:@"room_background"];
|
||||
self.middleImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
self.middleImageView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
|
||||
self.middleImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.middleImageView clipsToBounds];
|
||||
|
||||
self.downImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
self.downImageView.frame = CGRectMake(0, frame.size.height, frame.size.width, frame.size.height);
|
||||
self.downImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.downImageView clipsToBounds];
|
||||
|
||||
[self addSubview:self.middleImageView];
|
||||
[self addSubview:self.downImageView];
|
||||
[self addSubview:self.svgDisplayView];
|
||||
self.svgDisplayView.frame = CGRectMake(0, frame.size.height, frame.size.width, frame.size.height);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)startAnimate {
|
||||
- (void)startAnimate:(SVGAImageView *)displayView {
|
||||
self.animatePlay = YES;
|
||||
@weakify(self);
|
||||
NSString *bgString = [[NSBundle mainBundle] pathForResource:@"anchor_room_bg" ofType:@"svga"];
|
||||
NSURL *bgUrl = [NSURL fileURLWithPath:bgString];
|
||||
[self.parserManager loadSvgaWithURL:bgUrl completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@strongify(self);
|
||||
if (videoItem != nil) {
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
displayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
} else {//高大于宽
|
||||
CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度
|
||||
if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
displayView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
} else {//小于屏幕高度,
|
||||
self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
displayView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
}
|
||||
self.svgDisplayView.loops = INT_MAX;
|
||||
self.svgDisplayView.clearsAfterStop = NO;
|
||||
self.svgDisplayView.videoItem = videoItem;
|
||||
[self.svgDisplayView startAnimation];
|
||||
displayView.loops = INT_MAX;
|
||||
displayView.clearsAfterStop = NO;
|
||||
displayView.videoItem = videoItem;
|
||||
[displayView startAnimation];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)stopAnimate {
|
||||
[self.svgDisplayView stopAnimation];
|
||||
[self.middleDisplayView stopAnimation];
|
||||
[self.topDisplayView stopAnimation];
|
||||
[self.downDisplayView stopAnimation];
|
||||
self.animatePlay = NO;
|
||||
NSLog(@"动画结束了");
|
||||
}
|
||||
|
||||
- (void)roomMessageTabelViewStopScroll {
|
||||
self.scrollEnabled = YES;
|
||||
}
|
||||
|
||||
- (void)switchPlayer:(UIScrollView*)scrollView
|
||||
{
|
||||
- (void)switchPlayer:(UIScrollView*)scrollView {
|
||||
CGFloat offset = scrollView.contentOffset.y;
|
||||
if (offset >= self.frame.size.height)
|
||||
if (offset >= self.frame.size.height * 2)
|
||||
{
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollViewScrollToNext:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollViewScrollToNext:self];
|
||||
}
|
||||
[self stopAnimate];
|
||||
} else if (offset <= 0) {
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollViewScrollToPrevious:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollViewScrollToPrevious:self];
|
||||
}
|
||||
[self stopAnimate];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (scrollView.contentOffset.y > 0) {
|
||||
NSLog(@"滚动的Y:%.2f", scrollView.contentOffset.y);
|
||||
if (scrollView.contentOffset.y > KScreenHeight) {///乡上滚动
|
||||
if (scrollView.contentOffset.y <= (KScreenHeight * 1.5)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.animatePlay) {
|
||||
[self startAnimate];
|
||||
[self startAnimate:self.downDisplayView];
|
||||
}
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollVieEndScroll:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollVieStartScroll:self];
|
||||
} else {///向下滚动
|
||||
|
||||
if (scrollView.contentOffset.y > (KScreenHeight * 0.5)) {
|
||||
return;
|
||||
}
|
||||
} else if (scrollView.contentOffset.y == 0) {
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollVieEndScroll:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollVieEndScroll:self];
|
||||
|
||||
if (!self.animatePlay) {
|
||||
[self startAnimate:self.topDisplayView];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
[self switchPlayer:scrollView];
|
||||
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||
if (self.isCanScrollTop) {
|
||||
if (scrollView.contentOffset.y >= KScreenHeight * 2) {
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollViewScrollToNext:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollViewScrollToNext:self];
|
||||
}
|
||||
} else if(scrollView.contentOffset.y <= 0) {
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollViewScrollToPrevious:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollViewScrollToPrevious:self];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (scrollView.contentOffset.y >= KScreenHeight) {
|
||||
if (self.anchorScrollDelegate && [self.anchorScrollDelegate respondsToSelector:@selector(anchorScrollViewScrollToNext:)]) {
|
||||
[self.anchorScrollDelegate anchorScrollViewScrollToNext:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
[self stopAnimate];
|
||||
NSLog(@"scrollViewDidEndDeceleratingY:%.2f", scrollView.contentOffset.y);
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
||||
///666是外部的公屏消息列表
|
||||
@@ -140,14 +162,53 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)svgDisplayView {
|
||||
if (_svgDisplayView == nil) {
|
||||
_svgDisplayView = [[SVGAImageView alloc] init];
|
||||
_svgDisplayView.contentMode = UIViewContentModeScaleToFill;
|
||||
_svgDisplayView.userInteractionEnabled = NO;
|
||||
_svgDisplayView.backgroundColor = [UIColor clearColor];
|
||||
- (void)setIsCanScrollTop:(BOOL)isCanScrollTop {
|
||||
_isCanScrollTop = isCanScrollTop;
|
||||
CGRect frame = self.frame;
|
||||
if (_isCanScrollTop) {
|
||||
self.contentSize = CGSizeMake(0, frame.size.height * 3);
|
||||
self.topDisplayView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
|
||||
self.middleDisplayView.frame = CGRectMake(0, frame.size.height, frame.size.width, frame.size.height);
|
||||
self.downDisplayView.frame = CGRectMake(0, frame.size.height * 2, frame.size.width, frame.size.height);
|
||||
self.middleImageView = self.middleDisplayView;
|
||||
} else {
|
||||
self.contentSize = CGSizeMake(0, frame.size.height * 2);
|
||||
self.topDisplayView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
|
||||
self.middleDisplayView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
|
||||
self.downDisplayView.frame = CGRectMake(0, frame.size.height, frame.size.width, frame.size.height);
|
||||
self.middleImageView = self.middleDisplayView;
|
||||
}
|
||||
return _svgDisplayView;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)middleDisplayView {
|
||||
if (_middleDisplayView == nil) {
|
||||
_middleDisplayView = [[SVGAImageView alloc] init];
|
||||
_middleDisplayView.contentMode = UIViewContentModeScaleToFill;
|
||||
_middleDisplayView.userInteractionEnabled = NO;
|
||||
_middleDisplayView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _middleDisplayView;
|
||||
}
|
||||
|
||||
- (SVGAImageView *)topDisplayView {
|
||||
if (_topDisplayView == nil) {
|
||||
_topDisplayView = [[SVGAImageView alloc] init];
|
||||
_topDisplayView.contentMode = UIViewContentModeScaleToFill;
|
||||
_topDisplayView.userInteractionEnabled = NO;
|
||||
_topDisplayView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _topDisplayView;
|
||||
}
|
||||
|
||||
|
||||
- (SVGAImageView *)downDisplayView {
|
||||
if (_downDisplayView == nil) {
|
||||
_downDisplayView = [[SVGAImageView alloc] init];
|
||||
_downDisplayView.contentMode = UIViewContentModeScaleToFill;
|
||||
_downDisplayView.userInteractionEnabled = NO;
|
||||
_downDisplayView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _downDisplayView;
|
||||
}
|
||||
|
||||
- (SVGAParserManager *)parserManager {
|
||||
|
@@ -84,7 +84,7 @@
|
||||
[XCHUDTool showErrorWithMessage:@"房间公屏已关闭"];
|
||||
return;
|
||||
}
|
||||
[XPRoomSendTextView showTextView:self.superview delegate:self.delegate atUid:nil atNick:nil];
|
||||
[XPRoomSendTextView showTextView:[UIApplication sharedApplication].delegate.window delegate:self.delegate atUid:nil atNick:nil];
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -111,6 +111,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
///个播上划引导
|
||||
@property (nonatomic, strong) AnchorRoomSrollTipView *anchorScrollTipView;
|
||||
|
||||
///滚动过的个播列表
|
||||
@property (nonatomic,strong) NSMutableArray<NSString *> *anchorRoomList;
|
||||
///序号
|
||||
@property (nonatomic,assign) BOOL anchorIndex;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomViewController
|
||||
@@ -308,8 +313,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
make.right.equalTo(self.activityContainerView.mas_left).offset(-10);
|
||||
}];
|
||||
[self.menuContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(-kSafeAreaBottomHeight- 8);
|
||||
make.left.right.mas_equalTo(self.anchorScrollView.middleImageView);
|
||||
make.bottom.mas_equalTo(self.anchorScrollView.middleImageView).offset(-kSafeAreaBottomHeight- 8);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
[self.activityContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -775,9 +780,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
|
||||
///获取推荐滚动的个播房列表(只有第一次进房获取)
|
||||
- (void)getNextAnchorRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
self.anchorScrollView.contentOffset = CGPointMake(0, 0);
|
||||
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
|
||||
[self hideHUD];
|
||||
if (roomInfo) { //获取下一个房间成功
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
|
||||
if (![self.anchorRoomList containsObject:[NSString stringWithFormat:@"%ld", roomInfo.uid]]) {
|
||||
[self.anchorRoomList addObject:roomUid];
|
||||
}
|
||||
self.anchorIndex = self.anchorRoomList.count -1;
|
||||
//1、退出房间操作
|
||||
self.isRequestSuperAdmin = NO;
|
||||
[self exitOldRoom];
|
||||
@@ -807,6 +817,43 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
} else {
|
||||
[self showErrorToast:@"已经到底啦~自动为您返回当前房间"];
|
||||
}
|
||||
self.anchorScrollView.isScrollNext = NO;
|
||||
}
|
||||
|
||||
- (void)getCurrentRoomInfo:(RoomInfoModel *)roomInfo {
|
||||
[self hideHUD];
|
||||
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
|
||||
if (roomInfo && roomInfo.valid) {
|
||||
|
||||
//1、退出房间操作
|
||||
self.isRequestSuperAdmin = NO;
|
||||
[self exitOldRoom];
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[XPRoomMiniManager shareManager] resetLocalMessage];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
//2、移除房间子控件
|
||||
[self.backContainerView removeFromSuperview];
|
||||
[self.stageView removeFromSuperview];
|
||||
[self.messageContainerView removeFromSuperview];
|
||||
[self.activityContainerView removeFromSuperview];
|
||||
[self.roomHeaderView removeFromSuperview];
|
||||
[self.functionView removeFromSuperview];
|
||||
self.functionView = nil;
|
||||
self.messageContainerView = nil;
|
||||
self.stageView = nil;
|
||||
[self.menuContainerView removeFromSuperview];
|
||||
self.menuContainerView = nil;
|
||||
//3、重新进入房间
|
||||
self.roomUid = [NSString stringWithFormat:@"%zd", roomInfo.uid];
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
/// 公屏 福袋礼物爆出的礼物 需要依赖 当前房间中的礼物列表 需要提前获取礼物列表 可以拿到礼物 没有想到别的方法去解决这个问题 有需要改的在修改吧
|
||||
[self.presenter getNormalGiftList:self.roomUid];
|
||||
///获取房间超管列表
|
||||
[self.presenter getRoomSuperAdmin:self.roomUid];
|
||||
} else {
|
||||
[self showErrorToast:@"已经到顶啦~自动为您返回当前房间"];
|
||||
}
|
||||
}
|
||||
|
||||
///个播房初始化一些操作
|
||||
@@ -825,7 +872,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
} else {
|
||||
self.roomInfo.datingState = self.roomInfo.roomModeType == RoomModeType_Open_Blind ? RoomDatingStateChangeType_Open : RoomDatingStateChangeType_Normal;
|
||||
if (!self.anchorScrollView.superview) {
|
||||
[self.view insertSubview:self.anchorScrollView belowSubview:self.menuContainerView];
|
||||
[self.view addSubview:self.anchorScrollView];
|
||||
}
|
||||
[self.backContainerView removeFromSuperview];
|
||||
[self.stageView removeFromSuperview];
|
||||
@@ -833,6 +880,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.activityContainerView removeFromSuperview];
|
||||
[self.roomHeaderView removeFromSuperview];
|
||||
[self.functionView removeFromSuperview];
|
||||
[self.menuContainerView removeFromSuperview];
|
||||
|
||||
[self.anchorScrollView addSubview:self.backContainerView];
|
||||
[self.anchorScrollView addSubview:self.stageView];
|
||||
@@ -840,9 +888,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.anchorScrollView addSubview:self.activityContainerView];
|
||||
[self.anchorScrollView addSubview:self.roomHeaderView];
|
||||
[self.anchorScrollView addSubview:self.functionView];
|
||||
if (!self.menuContainerView.superview) {
|
||||
[self.view addSubview:self.menuContainerView];
|
||||
}
|
||||
[self.anchorScrollView addSubview:self.menuContainerView];
|
||||
|
||||
[self updateViewConstraintsOnAnchorRoom];
|
||||
[self changeStageViewOnAnchorRoom];
|
||||
|
||||
@@ -1376,21 +1423,21 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
[self.presenter getCycleAnchorRoomList:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
}
|
||||
|
||||
///个播开始滚动
|
||||
- (void)anchorScrollVieStartScroll:(AnchorRoomScrollView *)anchorScrollView {
|
||||
if (self.menuContainerView.alpha == 0) {
|
||||
|
||||
- (void)anchorScrollViewScrollToPrevious:(AnchorRoomScrollView *)anchorScrollView {
|
||||
if (!self || self.anchorRoomList.count <= 0) {
|
||||
return;
|
||||
}
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.menuContainerView.alpha = 0;
|
||||
}];
|
||||
[self.view endEditing:YES];
|
||||
[self showAnchorLoading];
|
||||
if (self.anchorIndex < self.anchorRoomList.count) {
|
||||
NSString * roomUid = [self.anchorRoomList objectAtIndex:self.anchorIndex];
|
||||
[self.presenter getCurrentRoomInfo:roomUid];
|
||||
self.anchorIndex --;
|
||||
}else {
|
||||
[self showErrorToast:@"已经到顶啦~自动为您返回当前房间"];
|
||||
self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight);
|
||||
}
|
||||
|
||||
///个播停止滚动
|
||||
- (void)anchorScrollVieEndScroll:(AnchorRoomScrollView *)anchorScrollView {
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
self.menuContainerView.alpha = 1;
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPRoomSettingInputViewDelegate
|
||||
@@ -1536,6 +1583,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
if (!_anchorScrollView) {
|
||||
_anchorScrollView = [[AnchorRoomScrollView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
_anchorScrollView.anchorScrollDelegate = self;
|
||||
if (@available(iOS 11.0, *)) {
|
||||
_anchorScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
}
|
||||
return _anchorScrollView;
|
||||
}
|
||||
@@ -1547,5 +1597,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
return _anchorScrollTipView;
|
||||
}
|
||||
|
||||
- (NSMutableArray<NSString *> *)anchorRoomList {
|
||||
if (!_anchorRoomList) {
|
||||
_anchorRoomList = [NSMutableArray array];
|
||||
}
|
||||
return _anchorRoomList;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user