Commit 859a366c cgx

优化轮播图自动无限循环播放

1 个父辈 3beeb052
...@@ -2276,7 +2276,7 @@ ...@@ -2276,7 +2276,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
...@@ -2352,7 +2352,7 @@ ...@@ -2352,7 +2352,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -2488,7 +2488,7 @@ ...@@ -2488,7 +2488,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
......
...@@ -79,6 +79,24 @@ ...@@ -79,6 +79,24 @@
// 自动登录请求(调用时机) // 自动登录请求(调用时机)
[UserRequestModel autoLoginRequestWithCompletion:^(UserRequestModel * _Nonnull requestModel) {}]; [UserRequestModel autoLoginRequestWithCompletion:^(UserRequestModel * _Nonnull requestModel) {}];
} }
[self.homeTV.headerView controllerWillAppear];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.homeTV.headerView controllerWillDisAppear];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[NoisePlayerManager sharedNoisePlayerManager] pauseAll];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NeedUpdateHomePage object:nil];
} }
#pragma mark - 先放大,再缩小 #pragma mark - 先放大,再缩小
...@@ -100,16 +118,6 @@ ...@@ -100,16 +118,6 @@
[view.layer addAnimation:animation forKey:nil]; [view.layer addAnimation:animation forKey:nil];
} }
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[NoisePlayerManager sharedNoisePlayerManager] pauseAll];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NeedUpdateHomePage object:nil];
}
- (void)needUpdate { - (void)needUpdate {
[self.homeTV.mj_header beginRefreshing]; [self.homeTV.mj_header beginRefreshing];
} }
......
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "HomeHeaderView.h"
#import "SafeSleepModel.h" #import "SafeSleepModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// APP首页自定义视图 /// APP首页自定义视图
@interface DSHomeView : UITableView @interface DSHomeView : UITableView
@property (nonatomic, strong) HomeHeaderView *headerView;
/// 刷新banner /// 刷新banner
/// @param bannerListData bannerListData /// @param bannerListData bannerListData
......
...@@ -6,12 +6,10 @@ ...@@ -6,12 +6,10 @@
// //
#import "DSHomeView.h" #import "DSHomeView.h"
#import "HomeHeaderView.h"
#import "CourseMusicCell.h" #import "CourseMusicCell.h"
#import "GoodSleepSoundCell.h" #import "GoodSleepSoundCell.h"
@interface DSHomeView () <UITableViewDelegate, UITableViewDataSource> @interface DSHomeView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) HomeHeaderView *headerView;
@property (nonatomic, strong) NSArray *courseMusicArr; @property (nonatomic, strong) NSArray *courseMusicArr;
/// 类型数据 /// 类型数据
@property (nonatomic, strong) NSArray *typeArr; @property (nonatomic, strong) NSArray *typeArr;
...@@ -27,7 +25,6 @@ ...@@ -27,7 +25,6 @@
self.showsVerticalScrollIndicator = NO; self.showsVerticalScrollIndicator = NO;
self.delegate = self; self.delegate = self;
self.dataSource = self; self.dataSource = self;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
[self registerClass:[CourseMusicCell class] forCellReuseIdentifier:NSStringFromClass([CourseMusicCell class])]; [self registerClass:[CourseMusicCell class] forCellReuseIdentifier:NSStringFromClass([CourseMusicCell class])];
[self registerClass:[GoodSleepSoundCell class] forCellReuseIdentifier:NSStringFromClass([GoodSleepSoundCell class])]; [self registerClass:[GoodSleepSoundCell class] forCellReuseIdentifier:NSStringFromClass([GoodSleepSoundCell class])];
self.tableHeaderView = self.headerView; self.tableHeaderView = self.headerView;
......
...@@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
/// @param listData listData /// @param listData listData
- (void)updateBannerWithListData:(NSArray *)listData; - (void)updateBannerWithListData:(NSArray *)listData;
- (void)controllerWillAppear;
- (void)controllerWillDisAppear;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -52,6 +52,14 @@ ...@@ -52,6 +52,14 @@
[self.barnnerView freshCarousel]; [self.barnnerView freshCarousel];
} }
- (void)controllerWillAppear {
[self.barnnerView controllerWillAppear];
}
- (void)controllerWillDisAppear {
[self.barnnerView controllerWillDisAppear];
}
#pragma mark - CWCarouselDatasource #pragma mark - CWCarouselDatasource
- (NSInteger)numbersForCarousel { - (NSInteger)numbersForCarousel {
return self.bannerDatas.count; return self.bannerDatas.count;
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
if (cellIndex == 0) { // 舒眠课程 if (cellIndex == 0) { // 舒眠课程
[self addSubview:self.courseIcon]; [self addSubview:self.courseIcon];
[self addSubview:self.courseLab]; [self addSubview:self.courseLab];
self.courseIcon.hidden = NO;
self.courseLab.hidden = NO;
self.courseLab.text = [NSString stringWithFormat:@"%d", model.count]; self.courseLab.text = [NSString stringWithFormat:@"%d", model.count];
[self.courseLab sizeToFit]; [self.courseLab sizeToFit];
...@@ -48,6 +50,9 @@ ...@@ -48,6 +50,9 @@
make.left.equalTo(self.courseIcon.mas_right).offset(6); make.left.equalTo(self.courseIcon.mas_right).offset(6);
make.centerY.equalTo(self.courseIcon); make.centerY.equalTo(self.courseIcon);
}]; }];
} else {
if (_courseIcon) { _courseIcon.hidden = YES; }
if (_courseLab) { _courseLab.hidden = YES; }
} }
CGFloat width = 128; CGFloat width = 128;
......
...@@ -122,5 +122,7 @@ extern char** gArgv; ...@@ -122,5 +122,7 @@ extern char** gArgv;
1、默认情况关闭手机静音按钮,进入Unity游戏后播放音频没有声音,需要到Unity工程-UnityAppController.mm修改源代码; 1、默认情况关闭手机静音按钮,进入Unity游戏后播放音频没有声音,需要到Unity工程-UnityAppController.mm修改源代码;
2、首次启动Unity游戏,默认会加载主APP启动页面,需要到Unity工程-UnityAppController+ViewHandling.mm修改源代码; 2、首次启动Unity游戏,默认会加载主APP启动页面,需要到Unity工程-UnityAppController+ViewHandling.mm修改源代码;
3、Unity工程不支持bitcode,需要关闭; 3、Unity工程不支持bitcode,需要关闭;
4、Unity工程有变化时需要手动编译生成新的UnityFramework.framework动态库,然后导入到该目录下:
$(PROJECT_DIR)/unity_build_framework(后续通过脚本优化?)
*/ */
@end @end
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
#pragma mark - 授权失败的回调 #pragma mark - 授权失败的回调
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) { - (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) {
NSString *errorMsg = nil; NSString *errorMsg = @"";
switch (error.code) { switch (error.code) {
case ASAuthorizationErrorCanceled: case ASAuthorizationErrorCanceled:
errorMsg = @"用户取消了授权请求"; errorMsg = @"用户取消了授权请求";
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
} }
DSLog(@"controller requests:%@, errorMsg:%@", controller.authorizationRequests, errorMsg); DSLog(@"controller requests:%@, errorMsg:%@", controller.authorizationRequests, errorMsg);
[DataStatisticsUtil event:Apple_Login attributes:@{@"name":@"苹果登录授权失败"}]; [DataStatisticsUtil event:Apple_Login attributes:@{@"name":errorMsg}];
} }
#pragma mark - ASAuthorizationControllerPresentationContextProviding #pragma mark - ASAuthorizationControllerPresentationContextProviding
......
...@@ -149,18 +149,12 @@ ...@@ -149,18 +149,12 @@
*/ */
- (void)controllerWillDisAppear; - (void)controllerWillDisAppear;
/// 滚动到指定下标 /// 滚动到指定下标
/// @param index 指定下标 /// @param index 指定下标
/// @param animation 是否开启滚动动画 /// @param animation 是否开启滚动动画
- (void)scrollTo:(NSInteger)index animation:(BOOL)animation; - (void)scrollTo:(NSInteger)index animation:(BOOL)animation;
@end @end
@interface CWCarouselCollectionView: UICollectionView<UIGestureRecognizerDelegate> @interface CWCarouselCollectionView: UICollectionView<UIGestureRecognizerDelegate>
@end @end
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!