Commit f1c2ed4b cgx

细节调整

1 个父辈 0a2586c5
......@@ -1940,7 +1940,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
);
MARKETING_VERSION = 1.0.4;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
......@@ -2005,7 +2005,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
);
MARKETING_VERSION = 1.0.4;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
......@@ -2132,7 +2132,7 @@
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/WeChat/WechatSDK",
"$(PROJECT_DIR)/DreamSleep/Vendors/UMSocial_6.10.4/SocialLibraries/QQ",
);
MARKETING_VERSION = 1.0.4;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
......
......@@ -71,6 +71,7 @@
[self.audioDescLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.audioNameLab);
make.top.equalTo(self.audioNameLab.mas_bottom).offset(10);
make.right.equalTo(self).offset(-17);
}];
[self.cornerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
......@@ -121,6 +122,7 @@
if (!_audioDescLab) {
_audioDescLab = [UILabel labWithFont:SysFont(14.0)];
_audioDescLab.dk_textColorPicker = DKColorPickerWithColors(SubTitleColor, ColorFromHexA(0xFFFFFF, .5), DSWhite);
_audioDescLab.numberOfLines = 0;
}
return _audioDescLab;
}
......
......@@ -247,7 +247,7 @@
if (hour == 0) {
return [NSString stringWithFormat:@"%02d:%02d", minute, secend];
} else if (minute == 0){
return [NSString stringWithFormat:@"%02d",secend];
return [NSString stringWithFormat:@"%02d", secend];
} else {
return [NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, secend];
}
......
......@@ -15,7 +15,13 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = DSWhite;
self.view.backgroundColor = DSBlack;
UILabel *alertLab = [UILabel labWithText:@"功能开发中,点击屏幕返回" font:BoldFont(20) fit:YES];
alertLab.textColor = DSWhite;
alertLab.textAlignment = NSTextAlignmentCenter;
alertLab.center = self.view.center;
[self.view addSubview:alertLab];
// 加载unity
}
......
......@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
/// 白噪音分页
/// 白噪音通用分页
@interface NoiseListController : UIViewController
- (instancetype)initWithNoiseTypeID:(NSInteger)typeID;
......
......@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
/// 音频数据共享单例对象
/// 白噪音音频数据共享单例对象
@interface NoiseDataManager : NSObject
SingletonH(NoiseDataManager)
......
......@@ -12,11 +12,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 白噪音小音频cell
@interface NoiseAudioCell : UICollectionViewCell
/// 白噪音首页音频小icon
@property (nonatomic, strong) UIButton *audioIV;
/// 数据model
@property (nonatomic, strong) NoiseAudioModel *model;
@end
NS_ASSUME_NONNULL_END
......@@ -8,6 +8,7 @@
#import "NoiseAudioCell.h"
@interface NoiseAudioCell ()
/// 白噪音音频名称
@property (nonatomic, strong) UILabel *nameLab;
@end
......
......@@ -6,7 +6,6 @@
//
#import "NoisePlayBar.h"
#import "NoiseAudioModel.h"
#import "NoisePlayView.h"
#import "NoiseAudioCell.h"
#import "TimingView.h"
......@@ -66,14 +65,25 @@
self.countTime = 60;
// 添加对单例对象白噪音播放列表变化通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatePlist:) name:NoisePlaylistHasChange object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(noisePlaylistHasChange:) name:NoisePlaylistHasChange object:nil];
// 监听定时按钮被点击事件通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openTimingView) name:NoiseTimingDidClick object:nil];
}
return self;
}
- (void)updatePlist:(NSNotification *)noti {
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NoisePlaylistHasChange object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:NoiseTimingDidClick object:nil];
[_timer invalidate];
_timer = nil;
[_timingView removeFromSuperview];
_timingView = nil;
}
#pragma mark - noti
- (void)noisePlaylistHasChange:(NSNotification *)noti {
NSArray *playList = noti.userInfo[@"playList"];
if (playList) {
WS(weakSelf);
......@@ -99,24 +109,11 @@
}
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NoisePlaylistHasChange object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:NoiseTimingDidClick object:nil];
[_timer invalidate];
_timer = nil;
[_timingView removeFromSuperview];
_timingView = nil;
}
- (void)openTimingView {
[self.timingView display];
}
- (void)showAudioListView {
[self.noisePlayView showNoisePlayViewWith:self.playBtn.selected];
}
#pragma mark - Actions
- (void)playNoiseAudio:(UIButton *)sender {
sender.selected = !sender.selected;
NSArray *playList = [NoiseDataManager sharedNoiseDataManager].playList;
......@@ -129,6 +126,11 @@
}
}
- (void)showAudioListView {
[self.noisePlayView showNoisePlayViewWith:self.playBtn.selected];
}
#pragma mark - lazy
- (UIImageView *)topIV {
if (!_topIV) {
_topIV = [UIImageView new];
......@@ -223,7 +225,7 @@
if (hour == 0) {
return [NSString stringWithFormat:@"%02d:%02d", minute, secend];
} else if (minute == 0){
return [NSString stringWithFormat:@"%02d",secend];
return [NSString stringWithFormat:@"%02d", secend];
} else {
return [NSString stringWithFormat:@"%02d:%02d:%02d", hour, minute, secend];
}
......
......@@ -9,15 +9,16 @@
NS_ASSUME_NONNULL_BEGIN
/// 首页白噪音播放音量控制界面
@interface NoisePlayView : UIView
/// 设置一键开启、一键暂停按钮状态
@property (nonatomic, assign) BOOL selected;
/// 显示白噪音列表页面
/// @param selected 按钮状态
- (void)showNoisePlayViewWith:(BOOL)selected;
/// 设置一键开启、一键暂停按钮状态
@property (nonatomic, assign) BOOL selected;
@end
NS_ASSUME_NONNULL_END
......@@ -237,17 +237,12 @@ static NSString *mainCell = @"inxx_mainCell";
pageItemCell.delegate = self;
BOOL selected = (idx == self.selectedIndex); //是否被选中
[pageItemCell refreshTypeCell:obj idx:idx isSelected:selected];
// [pageItemCell.titleLabel setText:obj.sub_name];
// [pageItemCell.titleLabel setTextColor:(selected ? _titleSelectedColor : _titleColor)];
// [pageItemCell.titleLabel setFont:(selected ? _titleSelectedFont : _titleFont)];
[scrollViewPage addSubview:pageItemCell];
[_pageCells addObject:pageItemCell];
}];
self.scrollViewPage = scrollViewPage;
}
CGRect childFrame;
- (void)addCollectionMain {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 0;
......@@ -268,13 +263,6 @@ CGRect childFrame;
self.collectionMain = collection;
[self addSubview:collection];
[self bringSubviewToFront:self.collectionMain];
// childFrame = frame;
// for (UIViewController *childVc in self.controllersClass) {
// //子控制器的frame.origin.y肯定要从其自己的0开始
// childFrame.origin.y = 0;
// childVc.view.frame = childFrame;
// }
}
- (void)addPageBottomLine {
......@@ -284,35 +272,6 @@ CGRect childFrame;
[self.scrollViewPage addSubview:_line];
}
//- (void)updateLineFrameWithIndex:(NSInteger)index {
// _lineWidth = [self lineWidthWithsSelectedIndex:index];
// _line.frame = CGRectMake(0, _pageBarHeight - 9, _lineWidth, _lineHeight);
// CGFloat width = [self lineCenterXWithIndex:index];
// _line.center = CGPointMake(width, _pageBarHeight - 4/2);
//}
//
//- (CGFloat)lineCenterXWithIndex:(NSInteger)index {
// __block CGFloat centerX = 0;
// [self.pageTypes enumerateObjectsUsingBlock:^(NoiseTypeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
// if (idx < index) {
// centerX = centerX + [_pageCellWs[idx] floatValue];
// } else {
// centerX = centerX + [_pageCellWs[idx] floatValue]/2;
// *stop = YES;
// }
// }];
// return centerX;
//}
//
//- (CGFloat)lineWidthWithsSelectedIndex:(NSInteger)index {
// self.selectedIndex = index;
// NoiseTypeModel *model = self.pageTypes[index];
// CGFloat adaptIconW = model.is_lock == 1 ? 20 : 0;
// UILabel *lab2 = [UILabel labWithText:model.sub_name font:BoldFont(15.0) fit:YES];
// CGFloat _lineWidth = lab2.width + adaptIconW;
// return _lineWidth;
//}
/** 更新/设置 下划线的 frame */
- (void)updateLineFrameWithIndex:(NSInteger)index {
_lineWidth = [self lineWidthWithsSelectedIndex:index];
......@@ -328,7 +287,6 @@ CGRect childFrame;
}
}
- (CGFloat)lineCenterXWithIndex:(NSInteger)index {
__block CGFloat centerX = 0;
[_pageTypes enumerateObjectsUsingBlock:^(NoiseTypeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
......@@ -367,26 +325,6 @@ CGRect childFrame;
[self removeObserver:self forKeyPath:@"selectedIndex"];
}
///// 刷新 CollectionPage的Cell 数据
///// @param selected 待刷新cell是否被选中
//- (void)reloadCollectionPageCell:(XXPageItemCell *)cell index:(NSInteger)index selected:(BOOL)selected {
// UILabel *titleLabel = cell.titleLabel;
// NoiseTypeModel *typeModel = self.pageTypes[index];
// UILabel *lab1 = [UILabel labWithText:typeModel.sub_name font:SysFont(14.0) fit:YES];
// UILabel *lab2 = [UILabel labWithText:typeModel.sub_name font:BoldFont(15.0) fit:YES];
// CGFloat scale = selected ? lab2.width/lab1.width : lab1.width/lab2.width;
// [UIView animateWithDuration:.3 animations:^{
// titleLabel.transform = CGAffineTransformMakeScale(scale, scale);
// } completion:^(BOOL finished) {
// //缩放结束后重置transform, 并设置当前对应的字体大小. 这样就能避免transform从小到大时字体模糊
// titleLabel.transform = CGAffineTransformIdentity;
// [titleLabel setFont:(selected ? self->_titleSelectedFont : self->_titleFont)];
// }];
// NoiseTypeModel *model = self.pageTypes[index];
// model.isSelected = selected;
// [cell refreshTypeCell:model idx:index];
//}
/// 刷新 CollectionPage的Cell 数据
/// @param selected 待刷新cell是否被选中
- (void)reloadCollectionPageCell:(XXPageItemCell *)cell index:(NSInteger)index selected:(BOOL)selected {
......@@ -406,9 +344,6 @@ CGRect childFrame;
[titleLabel setFont:(selected ? _titleSelectedFont : _titleFont)];
}
NoiseTypeModel *model = self.pageTypes[index];
// [titleLabel setText:model.sub_name];
// [titleLabel setTextColor:(selected ? _titleSelectedColor : _titleColor)];
[cell refreshTypeCell:model idx:index isSelected:selected];
}
......@@ -473,7 +408,6 @@ CGRect childFrame;
self->_didSelectCollectionPageItem = NO;
}];
[self updateCurrentScrollViewPageContentOffsetByIndex:index];
[self.collectionMain scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UICollectionViewScrollPositionLeft animated:YES];
......@@ -481,24 +415,19 @@ CGRect childFrame;
static float oldOffsetX;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (_didSelectCollectionPageItem) return;
if (scrollView == self.collectionMain) {
// 处理working中的2个分页标题底部线性指示器的实时属性
[self changePageLinePropertyiesWithSrollX:scrollView.contentOffset.x];
//处理working中的2个分页标题的实时属性
// 处理working中的2个分页标题的实时属性
[self changePageTitlePropertyiesWithSrollX:scrollView.contentOffset.x];
}
}
/// 处理working中的2个分页标题底部线性指示器的实时属性
/// @param x SrollX
- (void)changePageLinePropertyiesWithSrollX:(CGFloat)x {
//需要随滑动而改变UI样式:LineScrollTypeDynamicAnimation/LineScrollTypeDynamicLinear
if (_lineScrollType == LineScrollTypeDynamicAnimation || _lineScrollType == LineScrollTypeDynamicLinear) {
......@@ -527,7 +456,7 @@ static float oldOffsetX;
//保留减少消耗方案: 每一个 cell 的宽度都是_pageCellW,是相等的, 省去了 for 循环计算宽度
centerX = lineIndex * _pageCellW + _pageCellW/2 + changedW/2;
}
}else{ //划过半屏, lineIndex 值会+1
} else{ //划过半屏, lineIndex 值会+1
if (_pageCellWidthType == PageCellWidthTypeByTitleLength) {
CGFloat chazhi = [_pageCellWs[lineIndex] floatValue] - [_pageCellWs[lineIndex-1] floatValue];
chazhi = 0;
......@@ -538,9 +467,7 @@ static float oldOffsetX;
centerX = lineIndex * _pageCellW + _pageCellW/2 - changedW/2;
}
}
}else{
} else {
if ((x-kScreenWidth*lineIndex) < 0) { //未过半屏
if (_pageCellWidthType == PageCellWidthTypeByTitleLength) {
CGFloat chazhi = [_pageCellWs[lineIndex] floatValue] - [_pageCellWs[lineIndex-1] floatValue];
......@@ -551,7 +478,7 @@ static float oldOffsetX;
changedW = _pageCellW * scrollRatio * 2;
centerX = lineIndex * _pageCellW + _pageCellW/2 - changedW/2;
}
}else{ //划过半屏
} else { //划过半屏
if (_pageCellWidthType == PageCellWidthTypeByTitleLength) {
CGFloat chazhi = [_pageCellWs[lineIndex+1] floatValue] - [_pageCellWs[lineIndex] floatValue];
chazhi = 0;
......@@ -562,7 +489,6 @@ static float oldOffsetX;
centerX = lineIndex * _pageCellW + _pageCellW/2 + changedW/2;
}
}
}
_lineWidth = [self lineWidthWithsSelectedIndex:lineIndex]; //根据 lineIndex 值判断的静态宽度
......@@ -583,7 +509,6 @@ static float oldOffsetX;
/// 处理working中的2个分页标题的实时属性
/// @param x SrollX
- (void)changePageTitlePropertyiesWithSrollX:(CGFloat)x {
// 创建通用变量
int pageIndex = ABS(x) / kScreenWidth;
CGFloat xInScreen = x-kScreenWidth*pageIndex; //一屏内的位移距离
......@@ -653,7 +578,6 @@ static float oldOffsetX;
/** 需要在滑动结束后处理的各UI type */
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
if (_didSelectCollectionPageItem) return;
if (scrollView == _collectionMain) {
......
......@@ -12,9 +12,7 @@
+ (UserModel *)getUserLoginData {
UserModel *userModel = [NSKeyedUnarchiver unarchiveObjectWithData:kGetUserDefaultsObj(UserBasicInfo)];
DSLog(@"获取用户信息:%@", userModel.debugDescription);
// DSLog(@"获取用户信息:%@", userModel.debugDescription);
return userModel;
}
......@@ -77,7 +75,7 @@
// 发送更新用户数据显示UI通知
[[NSNotificationCenter defaultCenter] postNotificationName:HasUpdateUserDataNoti object:nil];
DSLog(@"保存用户信息:%@", model.debugDescription);
// DSLog(@"保存用户信息:%@", model.debugDescription);
}
+ (void)clearUserLoginData {
......@@ -99,9 +97,9 @@
loginVC.successBlock = ^{
if ([target respondsToSelector:sel]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[target performSelector:sel];
#pragma clang diagnostic pop
#pragma clang diagnostic pop
}
};
BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:loginVC];
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!