Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d87d2176
由
cgx
编写于
2022-05-17 15:25:46 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
首页舒眠课程和助眠音乐调整UI
1 个父辈
8b02b87a
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
30 行增加
和
45 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Basement/Utils/AdaptationUtil.h
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.m
DreamSleep/DreamSleep/Class/HomeModule/Home/Controller/HomeViewController.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/CourseMusicCell.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/GoodSleepSoundCell.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeBasicCell.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionView.m
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionViewCell.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
d87d217
...
@@ -1282,10 +1282,10 @@
...
@@ -1282,10 +1282,10 @@
D01814EA28002A8200583D4E /* DsMiddleView.m */,
D01814EA28002A8200583D4E /* DsMiddleView.m */,
D0A72E3D282B89AD00EED7BE /* DSHomeView.h */,
D0A72E3D282B89AD00EED7BE /* DSHomeView.h */,
D0A72E3E282B89AD00EED7BE /* DSHomeView.m */,
D0A72E3E282B89AD00EED7BE /* DSHomeView.m */,
D0A72E40282B8BA600EED7BE /* CourseMusicCell.h */,
D0A72E41282B8BA600EED7BE /* CourseMusicCell.m */,
D0A72E37282B566200EED7BE /* HomeBasicCell.h */,
D0A72E37282B566200EED7BE /* HomeBasicCell.h */,
D0A72E38282B566200EED7BE /* HomeBasicCell.m */,
D0A72E38282B566200EED7BE /* HomeBasicCell.m */,
D0A72E40282B8BA600EED7BE /* CourseMusicCell.h */,
D0A72E41282B8BA600EED7BE /* CourseMusicCell.m */,
D0A72E3A282B56E600EED7BE /* GoodSleepSoundCell.h */,
D0A72E3A282B56E600EED7BE /* GoodSleepSoundCell.h */,
D0A72E3B282B56E600EED7BE /* GoodSleepSoundCell.m */,
D0A72E3B282B56E600EED7BE /* GoodSleepSoundCell.m */,
D0506B1628054ECD00229278 /* SafeHelperCollectionView.h */,
D0506B1628054ECD00229278 /* SafeHelperCollectionView.h */,
...
...
DreamSleep/DreamSleep/Basement/Utils/AdaptationUtil.h
查看文件 @
d87d217
...
@@ -53,7 +53,6 @@
...
@@ -53,7 +53,6 @@
#define DSBlack [UIColor blackColor]
#define DSBlack [UIColor blackColor]
// clearColor
// clearColor
#define DSClearColor [UIColor clearColor]
#define DSClearColor [UIColor clearColor]
/** 主title颜色 */
/** 主title颜色 */
#define MainTextColor ColorFromHex(0x333333)
#define MainTextColor ColorFromHex(0x333333)
/** 子title颜色 */
/** 子title颜色 */
...
@@ -74,6 +73,8 @@
...
@@ -74,6 +73,8 @@
#define DarkTextColor ColorFromHex(0x6D7282)
#define DarkTextColor ColorFromHex(0x6D7282)
// 小文案颜色
// 小文案颜色
#define SmallTextColor ColorFromHex(0xAAAAAA)
#define SmallTextColor ColorFromHex(0xAAAAAA)
// 常用黑夜模式标题颜色
#define DkTitleColor ColorFromHex(0xE8E9E9)
/** 突出显示文案颜色 */
/** 突出显示文案颜色 */
#define HighlightColor ColorFromHex(0x1AB69A)
#define HighlightColor ColorFromHex(0x1AB69A)
...
...
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.m
查看文件 @
d87d217
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
if
(
self
=
[
super
initWithFrame
:
frame
])
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
_templeImgView
=
[
UIImageView
new
];
_templeImgView
=
[
UIImageView
new
];
_templeImgView
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
_templeImgView
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
[
_templeImgView
cornerRadius
:
1
0
.
0
];
[
_templeImgView
cornerRadius
:
1
2
.
0
];
[
self
.
contentView
addSubview
:
_templeImgView
];
[
self
.
contentView
addSubview
:
_templeImgView
];
_templeNameLb
=
[
UILabel
new
];
_templeNameLb
=
[
UILabel
new
];
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/Controller/HomeViewController.m
查看文件 @
d87d217
...
@@ -204,7 +204,6 @@
...
@@ -204,7 +204,6 @@
-
(
DSHomeView
*
)
homeTV
{
-
(
DSHomeView
*
)
homeTV
{
if
(
!
_homeTV
)
{
if
(
!
_homeTV
)
{
_homeTV
=
[[
DSHomeView
alloc
]
init
];
_homeTV
=
[[
DSHomeView
alloc
]
init
];
_homeTV
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
}
}
return
_homeTV
;
return
_homeTV
;
}
}
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/CourseMusicCell.m
查看文件 @
d87d217
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
make
.
top
.
equalTo
(
self
.
titleLab
.
mas_bottom
).
offset
(
17
);
make
.
top
.
equalTo
(
self
.
titleLab
.
mas_bottom
).
offset
(
17
);
make
.
left
.
equalTo
(
self
.
verticalView
);
make
.
left
.
equalTo
(
self
.
verticalView
);
make
.
right
.
equalTo
(
self
.
contentView
);
make
.
right
.
equalTo
(
self
.
contentView
);
make
.
bottom
.
equalTo
(
self
.
contentView
)
.
offset
(
0
)
;
make
.
bottom
.
equalTo
(
self
.
contentView
);
}];
}];
}
}
return
self
;
return
self
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/DSHomeView.m
查看文件 @
d87d217
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
-
(
instancetype
)
init
{
-
(
instancetype
)
init
{
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
)
-
kTabBarHeight
)
style
:
UITableViewStylePlain
])
{
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
)
-
kTabBarHeight
)
style
:
UITableViewStylePlain
])
{
self
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
self
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
self
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
self
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
self
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
self
.
showsVerticalScrollIndicator
=
NO
;
self
.
showsVerticalScrollIndicator
=
NO
;
self
.
delegate
=
self
;
self
.
delegate
=
self
;
...
@@ -80,11 +81,11 @@
...
@@ -80,11 +81,11 @@
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
CGFloat
height
=
30
0
;
CGFloat
height
=
0
;
if
(
indexPath
.
row
==
0
)
{
if
(
indexPath
.
row
==
0
)
{
height
=
2
06
;
height
=
2
28
;
}
else
if
(
indexPath
.
row
==
1
)
{
}
else
if
(
indexPath
.
row
==
1
)
{
height
=
2
06
;
height
=
2
28
;
}
else
if
(
indexPath
.
row
==
2
)
{
}
else
if
(
indexPath
.
row
==
2
)
{
height
=
68
+
40
+
327
+
70
;
height
=
68
+
40
+
327
+
70
;
}
}
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/GoodSleepSoundCell.m
查看文件 @
d87d217
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
[
self
.
contentView
addSubview
:
self
.
noiseView
];
[
self
.
contentView
addSubview
:
self
.
noiseView
];
[
self
.
timerBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
timerBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
self
.
contentView
.
mas_right
).
offset
(
-
5
);
make
.
right
.
equalTo
(
self
.
contentView
.
mas_right
).
offset
(
-
1
5
);
make
.
width
.
equalTo
(
@
10
0
);
make
.
width
.
equalTo
(
@
4
0
);
make
.
height
.
equalTo
(
@30
);
make
.
height
.
equalTo
(
@30
);
make
.
centerY
.
equalTo
(
self
.
verticalView
.
mas_centerY
);
make
.
centerY
.
equalTo
(
self
.
verticalView
.
mas_centerY
);
}];
}];
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/HomeBasicCell.m
查看文件 @
d87d217
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
[
self
.
contentView
addSubview
:
self
.
titleLab
];
[
self
.
contentView
addSubview
:
self
.
titleLab
];
[
self
.
verticalView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
verticalView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
contentView
.
mas_left
).
offset
(
1
0
);
make
.
left
.
equalTo
(
self
.
contentView
.
mas_left
).
offset
(
1
5
);
make
.
top
.
equalTo
(
self
.
contentView
.
mas_top
).
offset
(
33
);
make
.
top
.
equalTo
(
self
.
contentView
.
mas_top
).
offset
(
33
);
make
.
width
.
equalTo
(
@4
);
make
.
width
.
equalTo
(
@4
);
make
.
height
.
equalTo
(
@16
);
make
.
height
.
equalTo
(
@16
);
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
self
.
titleLab
.
text
=
model
.
title
;
self
.
titleLab
.
text
=
model
.
title
;
[
self
.
titleLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
titleLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
verticalView
.
mas_right
).
offset
(
10
);
make
.
left
.
equalTo
(
self
.
verticalView
.
mas_right
).
offset
(
8
);
make
.
centerY
.
equalTo
(
self
.
verticalView
.
mas_centerY
);
make
.
centerY
.
equalTo
(
self
.
verticalView
.
mas_centerY
);
}];
}];
}
}
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionView.m
查看文件 @
d87d217
...
@@ -21,10 +21,10 @@
...
@@ -21,10 +21,10 @@
-
(
instancetype
)
initWithCellIndex
:(
NSInteger
)
cellIndex
{
-
(
instancetype
)
initWithCellIndex
:(
NSInteger
)
cellIndex
{
self
.
cellIndex
=
cellIndex
;
self
.
cellIndex
=
cellIndex
;
self
.
courseListData
=
@[];
self
.
courseListData
=
@[];
CGFloat
width
=
cellIndex
==
0
?
100
:
90
;
CGFloat
width
=
128
;
CGFloat
height
=
cellIndex
==
0
?
130
:
120
;
CGFloat
height
=
158
;
UICollectionViewFlowLayout
*
layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
UICollectionViewFlowLayout
*
layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
layout
.
sectionInset
=
UIEdgeInsetsMake
(
0
,
0
,
0
,
1
0
);
layout
.
sectionInset
=
UIEdgeInsetsMake
(
0
,
0
,
0
,
1
5
);
layout
.
itemSize
=
CGSizeMake
(
width
,
height
);
layout
.
itemSize
=
CGSizeMake
(
width
,
height
);
layout
.
minimumLineSpacing
=
12
;
layout
.
minimumLineSpacing
=
12
;
layout
.
scrollDirection
=
UICollectionViewScrollDirectionHorizontal
;
layout
.
scrollDirection
=
UICollectionViewScrollDirectionHorizontal
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Home/View/SafeHelperCollectionViewCell.m
查看文件 @
d87d217
...
@@ -8,8 +8,6 @@
...
@@ -8,8 +8,6 @@
#import "SafeHelperCollectionViewCell.h"
#import "SafeHelperCollectionViewCell.h"
@interface
SafeHelperCollectionViewCell
()
@interface
SafeHelperCollectionViewCell
()
// 圆角视图(舒眠课程Cell显示)
@property
(
nonatomic
,
strong
)
UIView
*
roundedView
;
// 主圆角图片
// 主圆角图片
@property
(
nonatomic
,
strong
)
UIImageView
*
homeIV
;
@property
(
nonatomic
,
strong
)
UIImageView
*
homeIV
;
// 舒眠课程icon
// 舒眠课程icon
...
@@ -36,58 +34,41 @@
...
@@ -36,58 +34,41 @@
[
self
.
audioTypeLab
sizeToFit
];
[
self
.
audioTypeLab
sizeToFit
];
if
(
cellIndex
==
0
)
{
// 舒眠课程
if
(
cellIndex
==
0
)
{
// 舒眠课程
[
self
insertSubview
:
self
.
roundedView
belowSubview
:
self
.
homeIV
];
[
self
addSubview
:
self
.
courseIcon
];
[
self
addSubview
:
self
.
courseIcon
];
[
self
addSubview
:
self
.
courseLab
];
[
self
addSubview
:
self
.
courseLab
];
self
.
courseLab
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
count
];
self
.
courseLab
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
count
];
[
self
.
courseLab
sizeToFit
];
[
self
.
courseLab
sizeToFit
];
[
self
.
roundedView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
);
make
.
width
.
equalTo
(
@
(
100
-
2
*
12
));
make
.
height
.
equalTo
(
@20
);
make
.
centerX
.
equalTo
(
self
.
homeIV
);
}];
[
self
.
courseIcon
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
courseIcon
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
homeIV
).
offset
(
7
);
make
.
left
.
equalTo
(
self
.
homeIV
).
offset
(
8
);
make
.
bottom
.
equalTo
(
self
.
homeIV
).
offset
(
-
3
);
make
.
bottom
.
equalTo
(
self
.
homeIV
).
offset
(
-
8
);
}];
}];
[
self
.
courseLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
courseLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
courseIcon
.
mas_right
).
offset
(
2
);
make
.
left
.
equalTo
(
self
.
courseIcon
.
mas_right
).
offset
(
6
);
make
.
centerY
.
equalTo
(
self
.
courseIcon
);
make
.
centerY
.
equalTo
(
self
.
courseIcon
);
}];
}];
}
}
CGFloat
width
=
cellIndex
==
0
?
100
:
90
;
CGFloat
width
=
128
;
CGFloat
bottomSpace
=
cellIndex
==
0
?
0
:
-
3
;
CGFloat
topSpacing
=
cellIndex
==
0
?
4
:
0
;
[
self
.
homeIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
homeIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
).
offset
(
topSpacing
);
make
.
top
.
equalTo
(
self
.
contentView
);
make
.
left
.
equalTo
(
self
);
make
.
left
.
equalTo
(
self
);
make
.
width
.
height
.
equalTo
(
@
(
width
));
make
.
width
.
height
.
equalTo
(
@
(
width
));
}];
}];
[
self
.
audioTypeLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
audioTypeLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
homeIV
);
make
.
left
.
equalTo
(
self
.
homeIV
);
make
.
bottom
.
equalTo
(
self
).
offset
(
bottomSpace
);
make
.
bottom
.
equalTo
(
self
.
contentView
);
}];
}];
}
}
#pragma mark - lazy
#pragma mark - lazy
-
(
UIView
*
)
roundedView
{
if
(
!
_roundedView
)
{
_roundedView
=
[
UIView
new
];
_roundedView
.
backgroundColor
=
ColorFromHex
(
0xECECEC
);
_roundedView
.
layer
.
cornerRadius
=
12
;
_roundedView
.
layer
.
masksToBounds
=
YES
;
}
return
_roundedView
;
}
-
(
UIImageView
*
)
homeIV
{
-
(
UIImageView
*
)
homeIV
{
if
(
!
_homeIV
)
{
if
(
!
_homeIV
)
{
_homeIV
=
[
UIImageView
new
];
_homeIV
=
[
UIImageView
new
];
_homeIV
.
contentMode
=
UIViewContentModeScaleAspectFill
;
_homeIV
.
contentMode
=
UIViewContentModeScaleAspectFill
;
[
_homeIV
cornerRadius
:
12
.
0
];
_homeIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
}
}
return
_homeIV
;
return
_homeIV
;
}
}
...
@@ -96,20 +77,23 @@
...
@@ -96,20 +77,23 @@
if
(
!
_courseIcon
)
{
if
(
!
_courseIcon
)
{
_courseIcon
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"courseIcon"
]];
_courseIcon
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"courseIcon"
]];
[
_courseIcon
sizeToFit
];
[
_courseIcon
sizeToFit
];
_courseIcon
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
}
}
return
_courseIcon
;
return
_courseIcon
;
}
}
-
(
UILabel
*
)
courseLab
{
-
(
UILabel
*
)
courseLab
{
if
(
!
_courseLab
)
{
if
(
!
_courseLab
)
{
_courseLab
=
[
UILabel
labWithTextColor
:
DSWhite
font
:
SysFont
(
10
)];
_courseLab
=
[
UILabel
labWithFont
:
SysFont
(
12
)];
_courseLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
DSWhite
,
DkTitleColor
,
DSWhite
);
}
}
return
_courseLab
;
return
_courseLab
;
}
}
-
(
UILabel
*
)
audioTypeLab
{
-
(
UILabel
*
)
audioTypeLab
{
if
(
!
_audioTypeLab
)
{
if
(
!
_audioTypeLab
)
{
_audioTypeLab
=
[
UILabel
dkLabWithFont
:
SysFont
(
15
)];
_audioTypeLab
=
[
UILabel
labWithFont
:
SysFont
(
15
)];
_audioTypeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
DkTitleColor
,
DSWhite
);
}
}
return
_audioTypeLab
;
return
_audioTypeLab
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论