Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8b02b87a
由
cgx
编写于
2022-05-17 12:37:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
更新舒眠课程和助眠音乐列表页面UI布局
1 个父辈
f329caab
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
81 行增加
和
28 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Basement/DSConfig/Info.plist
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/LookAllController.m
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/SafeSleepListController.m
DreamSleep/DreamSleep/Class/HomeModule/Course/Model/CourseModel.h
DreamSleep/DreamSleep/Class/HomeModule/Course/Model/CourseModel.m
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.h
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.m
DreamSleep/TapiOS/LaunchScreen-iPhone.storyboard
DreamSleep/TapiOS/Unity-iPhone.xcodeproj/xcshareddata/xcschemes/Unity-iPhone.xcscheme
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
8b02b87
...
...
@@ -1933,7 +1933,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM =
SPH85C3TWU
;
DEVELOPMENT_TEAM =
38Y8286C84
;
EXCLUDED_ARCHS = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -1960,6 +1960,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = UIUserInterfaceStyleLight;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -2027,6 +2028,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = UIUserInterfaceStyleLight;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -2156,6 +2158,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = UIUserInterfaceStyleLight;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
DreamSleep/DreamSleep/Basement/DSConfig/Info.plist
查看文件 @
8b02b87
...
...
@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
UIUserInterfaceStyle
</key>
<string>
UIUserInterfaceStyleLight
</string>
<key>
Bundle_Display_Name
</key>
<string>
$(App_Display_Name)
</string>
<key>
CFBundleURLTypes
</key>
...
...
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/LookAllController.m
查看文件 @
8b02b87
...
...
@@ -51,7 +51,7 @@
[
btn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
MainTextColor
,
ColorFromHex
(
0xE8E9E9
),
DSWhite
)
forState
:
UIControlStateNormal
];
}
else
{
[
btn
.
titleLabel
setFont
:
SysFont
(
15
)];
[
btn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
SubTitleColor
,
ColorFromHex
(
0x7A7F8E
),
DSWhite
)
forState
:
UIControlStateNormal
];
[
btn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
ColorFromHexA
(
0x333333
,
.
49
)
,
ColorFromHex
(
0x7A7F8E
),
DSWhite
)
forState
:
UIControlStateNormal
];
}
}
}
...
...
@@ -59,7 +59,7 @@
-
(
void
)
switchViewControllerAction
:
(
UIButton
*
)
sender
{
_selectedIndex
=
sender
.
tag
;
[
UIView
animateWithDuration
:.
3
animations
:
^
{
self
->
_indicatorView
.
x
=
sender
.
x
;
self
->
_indicatorView
.
centerX
=
sender
.
centerX
;
[
self
->
_bodyView
setContentOffset
:
CGPointMake
(
sender
.
tag
*
self
->
_bodyView
.
width
,
0
)];
}];
[
self
adjustUI
];
...
...
@@ -93,7 +93,7 @@
_selectedIndex
=
index
;
UIButton
*
btn
=
_btns
[
index
];
[
UIView
animateWithDuration
:.
3
animations
:
^
{
self
->
_indicatorView
.
x
=
btn
.
x
;
self
->
_indicatorView
.
centerX
=
btn
.
centerX
;
}];
[
self
adjustUI
];
}
...
...
@@ -103,12 +103,13 @@
if
(
!
_headView
)
{
_headView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
15
,
0
,
kScreenWidth
-
30
,
40
)];
UIButton
*
btn1
=
[
self
btnWithTitle
:
@"舒眠课程"
font
:
BoldFont
(
16
)
tag
:
0
sView
:
_headView
];
UIButton
*
btn2
=
[
self
btnWithTitle
:
@"放松音乐"
font
:
SysFont
(
15
)
tag
:
1
sView
:
_headView
];
_indicatorView
=
[
UIView
new
];
_indicatorView
.
backgroundColor
=
BrandColor
;
[
_headView
addSubview
:
_indicatorView
];
UIButton
*
btn1
=
[
self
btnWithTitle
:
@"舒眠课程"
font
:
BoldFont
(
16
)
tag
:
0
sView
:
_headView
];
UIButton
*
btn2
=
[
self
btnWithTitle
:
@"放松音乐"
font
:
SysFont
(
15
)
tag
:
1
sView
:
_headView
];
[
btn1
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
_headView
);
make
.
bottom
.
equalTo
(
_headView
).
offset
(
1
);
...
...
@@ -120,10 +121,10 @@
make
.
size
.
equalTo
(
btn1
);
}];
[
_indicatorView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
width
.
equalTo
(
btn1
);
make
.
width
.
equalTo
(
@64
);
make
.
centerX
.
equalTo
(
_defaultIndex
==
0
?
btn1
:
btn2
);
make
.
height
.
equalTo
(
@4
);
make
.
bottom
.
equalTo
(
_headView
);
make
.
bottom
.
equalTo
(
_headView
)
.
offset
(
-
4
)
;
}];
_btns
=
@[
btn1
,
btn2
];
...
...
DreamSleep/DreamSleep/Class/HomeModule/Course/Controller/SafeSleepListController.m
查看文件 @
8b02b87
...
...
@@ -55,19 +55,16 @@
return
self
.
listArr
.
count
;
}
-
(
__kindof
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
-
(
__kindof
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
CourseCollectionCell
*
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"CourseCollectionCellID"
forIndexPath
:
indexPath
];
CourseModel
*
model
=
[
self
.
listArr
objectAtIndex
:
indexPath
.
row
];
if
(
indexPath
.
row
<
self
.
listArr
.
count
)
{
cell
.
model
=
model
;
}
cell
.
courseType
=
_type
;
return
cell
;
}
-
(
UIEdgeInsets
)
collectionView
:
(
UICollectionView
*
)
collectionView
layout
:
(
UICollectionViewLayout
*
)
collectionViewLayout
insetForSectionAtIndex
:
(
NSInteger
)
section
{
return
UIEdgeInsetsMake
(
24
,
15
,
24
,
15
);
}
-
(
void
)
collectionView
:
(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
self
.
listArr
.
count
>
indexPath
.
row
)
{
CourseModel
*
model
=
[
self
.
listArr
objectAtIndex
:
indexPath
.
row
];
...
...
@@ -84,9 +81,9 @@
UICollectionViewFlowLayout
*
layout
=
[[
UICollectionViewFlowLayout
alloc
]
init
];
layout
.
sectionFootersPinToVisibleBounds
=
YES
;
layout
.
scrollDirection
=
UICollectionViewScrollDirectionVertical
;
CGFloat
width
=
(
kScreenWidth
-
60
)
/
3
;
layout
.
itemSize
=
CGSizeMake
(
width
,
130
)
;
layout
.
minimum
InteritemSpacing
=
15
;
layout
.
itemSize
=
[
CourseModel
itemSize
]
;
layout
.
sectionInset
=
[
CourseModel
sectionEdgeInset
]
;
layout
.
minimum
LineSpacing
=
[
CourseModel
minimumLineSpacing
]
;
_courseListView
=
[[
UICollectionView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
self
.
view
.
height
-
Bottom_SafeArea_Height
-
kTopHeight
(
0
)
-
40
)
collectionViewLayout
:
layout
];
_courseListView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
_courseListView
.
showsVerticalScrollIndicator
=
NO
;
...
...
DreamSleep/DreamSleep/Class/HomeModule/Course/Model/CourseModel.h
查看文件 @
8b02b87
...
...
@@ -35,6 +35,15 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
)
NSString
*
home_img
;
// 课程数量
@property
(
nonatomic
,
assign
)
int
count
;
#pragma mark - 用于计算cell大小
+
(
CGFloat
)
cellWidth
;
+
(
CGFloat
)
cellHeight
;
+
(
CGFloat
)
leftRightMargin
;
+
(
CGFloat
)
midSpace
;
+
(
CGFloat
)
minimumLineSpacing
;
+
(
CGSize
)
itemSize
;
+
(
UIEdgeInsets
)
sectionEdgeInset
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/HomeModule/Course/Model/CourseModel.m
查看文件 @
8b02b87
...
...
@@ -13,4 +13,48 @@
return
@{
@"course_id"
:
@"id"
};
}
+
(
CGFloat
)
cellWidth
{
CGFloat
width
=
166
;
if
(
iPhone5
)
{
width
=
80
;
}
return
width
;
}
+
(
CGFloat
)
cellHeight
{
return
[
self
cellWidth
]
+
30
;
}
+
(
CGFloat
)
leftRightMargin
{
return
15
;
}
+
(
CGFloat
)
midSpace
{
return
0
;
}
+
(
CGFloat
)
minimumLineSpacing
{
return
24
;
}
+
(
CGFloat
)
sectionTop
{
return
24
;
}
+
(
int
)
itemCount
{
CGFloat
itemCount
=
2
;
if
(
iPhone5
)
{
itemCount
=
3
;
}
return
itemCount
;
}
+
(
CGSize
)
itemSize
{
return
CGSizeMake
([
self
cellWidth
],
[
self
cellHeight
]);
}
+
(
UIEdgeInsets
)
sectionEdgeInset
{
return
UIEdgeInsetsMake
([
self
sectionTop
],
[
self
leftRightMargin
],
[
self
sectionTop
],
[
self
leftRightMargin
]);
}
@end
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.h
查看文件 @
8b02b87
...
...
@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 舒眠课程和助眠音乐课程列表Cell
@interface
CourseCollectionCell
:
UICollectionViewCell
@property
(
nonatomic
,
strong
)
CourseModel
*
model
;
@property
(
nonatomic
,
assign
)
CourseType
courseType
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/HomeModule/Course/View/CourseCollectionCell.m
查看文件 @
8b02b87
...
...
@@ -18,20 +18,20 @@
if
(
self
=
[
super
initWithFrame
:
frame
])
{
_templeImgView
=
[
UIImageView
new
];
_templeImgView
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
[
_templeImgView
cornerRadius
:
10
.
0
];
[
self
.
contentView
addSubview
:
_templeImgView
];
_templeNameLb
=
[
UILabel
new
];
_templeNameLb
.
textAlignment
=
NSTextAlignmentLeft
;
_templeNameLb
.
font
=
SysFont
(
1
4
);
_templeNameLb
.
font
=
SysFont
(
1
5
);
_templeNameLb
.
textAlignment
=
0
;
_templeNameLb
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitle
Color
,
ColorFromHex
(
0x7E8392
),
DSWhite
);
_templeNameLb
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainText
Color
,
ColorFromHex
(
0x7E8392
),
DSWhite
);
[
self
.
contentView
addSubview
:
_templeNameLb
];
[
_templeImgView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
contentView
.
mas_top
).
offset
(
5
);
make
.
centerX
.
equalTo
(
self
.
contentView
.
mas_centerX
);
make
.
height
.
equalTo
(
@90
);
make
.
width
.
equalTo
(
@90
);
make
.
left
.
equalTo
(
self
.
contentView
);
make
.
width
.
height
.
equalTo
(
@
([
CourseModel
cellWidth
]));
}];
[
_templeNameLb
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
templeImgView
.
mas_left
);
...
...
@@ -48,4 +48,5 @@
[
self
.
templeImgView
yy_setImageWithURL
:[
NSURL
URLWithString
:
model
.
audio_img
]
placeholder
:[
UIImage
imageNamed
:
@"basicPlaceholder"
]];
self
.
templeNameLb
.
text
=
model
.
audio_name
;
}
@end
DreamSleep/TapiOS/LaunchScreen-iPhone.storyboard
查看文件 @
8b02b87
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"
15702
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"UnityLaunchScreen-ViewController"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"
20037
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"UnityLaunchScreen-ViewController"
>
<device
id=
"ipad9_7"
orientation=
"portrait"
layout=
"fullscreen"
appearance=
"light"
/>
<dependencies>
<deployment
version=
"4352"
identifier=
"iOS"
/>
<development
version=
"9000"
identifier=
"xcode"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"15704"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"20020"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
...
...
@@ -39,6 +38,6 @@
</scene>
</scenes>
<resources>
<image
name=
"LaunchScreen-iPhonePortrait.png"
width=
"1
242"
height=
"2208
"
/>
<image
name=
"LaunchScreen-iPhonePortrait.png"
width=
"1
"
height=
"1
"
/>
</resources>
</document>
DreamSleep/TapiOS/Unity-iPhone.xcodeproj/xcshareddata/xcschemes/Unity-iPhone.xcscheme
查看文件 @
8b02b87
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"
050
0"
LastUpgradeVersion =
"
133
0"
version =
"2.0"
>
<BuildAction
parallelizeBuildables =
"YES"
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论