Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6666520c
由
cgx
编写于
2022-04-14 17:02:10 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
导航栏白天夜间模式
1 个父辈
3588475b
全部展开
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
100 行增加
和
107 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/HomeModule/Home/Controller/HomeViewController.m
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
DreamSleep/DreamSleep/Profile/Profile.storyboard
DreamSleep/DreamSleep/Profile/ProfileController.m
DreamSleep/DreamSleep/TmpViewController.h → DreamSleep/DreamSleep/Profile/SystemSetController.h
DreamSleep/DreamSleep/Profile/SystemSetController.m
DreamSleep/DreamSleep/TmpViewController.m
DreamSleep/DreamSleep/ViewController.h
DreamSleep/DreamSleep/ViewController.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
6666520
此文件的差异被折叠,
点击展开。
DreamSleep/DreamSleep/HomeModule/Home/Controller/HomeViewController.m
查看文件 @
6666520
...
...
@@ -27,9 +27,9 @@
self
.
navigationItem
.
leftBarButtonItem
=
leftItem
;
}
#pragma mark - 导航栏日间模式
#pragma mark - 导航栏日间
、黑夜
模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleLight
;
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
NaviStyleLight
:
NaviStyleDark
;
}
-
(
HomeTableView
*
)
homeTV
{
...
...
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
查看文件 @
6666520
...
...
@@ -16,6 +16,8 @@
@property
(
nonatomic
,
copy
)
NSURL
*
link
;
@property
(
nonatomic
,
assign
)
BOOL
isDetail
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
// 黑夜模式遮罩(到时候提取出来,全局通用)
@property
(
nonatomic
,
strong
)
UIView
*
darkMaskView
;
@end
@implementation
PrivacyViewController
...
...
@@ -40,6 +42,12 @@
}
else
{
[
self
showPrivacyView
];
}
self
.
darkMaskView
.
hidden
=
!
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNight
];
}
-
(
void
)
dealloc
{
[
self
.
maskView
removeFromSuperview
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
...
@@ -78,4 +86,15 @@
return
_webView
;
}
-
(
UIView
*
)
darkMaskView
{
if
(
!
_darkMaskView
)
{
_darkMaskView
=
[[
UIView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
];
_darkMaskView
.
backgroundColor
=
ColorFromHex
(
0x6B7485
);
_darkMaskView
.
alpha
=
.
5
;
_darkMaskView
.
userInteractionEnabled
=
NO
;
[
self
.
view
addSubview
:
_darkMaskView
];
}
return
_darkMaskView
;
}
@end
DreamSleep/DreamSleep/Profile/Profile.storyboard
查看文件 @
6666520
...
...
@@ -11,7 +11,7 @@
<!--我的-->
<scene
sceneID=
"XXm-nW-BLl"
>
<objects>
<navigationController
automaticallyAdjustsScrollViewInsets=
"NO"
id=
"z46-F3-9B2"
sceneMemberID=
"viewController"
>
<navigationController
automaticallyAdjustsScrollViewInsets=
"NO"
id=
"z46-F3-9B2"
customClass=
"BaseNaviController"
sceneMemberID=
"viewController"
>
<tabBarItem
key=
"tabBarItem"
title=
"我的"
image=
"profile"
selectedImage=
"profile_selected"
id=
"q0K-3e-nOn"
/>
<toolbarItems/>
<navigationBar
key=
"navigationBar"
contentMode=
"scaleToFill"
id=
"kJv-b2-G2C"
>
...
...
DreamSleep/DreamSleep/Profile/ProfileController.m
查看文件 @
6666520
...
...
@@ -6,9 +6,10 @@
//
#import "ProfileController.h"
#import "SystemSetController.h"
@interface
ProfileController
()
@property
(
nonatomic
,
strong
)
NSArray
*
tmpDatas
;
@end
@implementation
ProfileController
...
...
@@ -16,35 +17,43 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
navigationItem
.
title
=
@"我的"
;
self
.
tableView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
self
.
tmpDatas
=
@[
@"注册登录信息"
,
@"意见反馈"
,
@"系统设置"
,
@"邀请好友"
,
@"关于我们"
,
@"前往小程序"
,
@"关注公众号"
,
@"添加客服微信"
,
@"失眠的认知行为疗法"
];
}
#pragma mark - 导航栏日间、黑夜模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
#pragma mark - Table view data source
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
1
;
return
self
.
tmpDatas
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"profileCell"
forIndexPath
:
indexPath
];
cell
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
cell
.
textLabel
.
text
=
self
.
tmpDatas
[
indexPath
.
row
];
cell
.
textLabel
.
dk_textColorPicker
=
DKColorPickerWithKey
(
TEXT
);
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
// 模拟切换黑夜模式
if
([
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNight
])
{
self
.
dk_manager
.
themeVersion
=
DKThemeVersionNormal
;
}
else
{
self
.
dk_manager
.
themeVersion
=
DKThemeVersionNight
;
}
}
/*
#pragma mark - Navigation
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
switch
(
indexPath
.
row
)
{
case
2
:
// 系统设置入口
{
SystemSetController
*
sysVC
=
[
SystemSetController
new
];
[
self
.
navigationController
pushViewController
:
sysVC
animated
:
YES
];
}
break
;
default
:
break
;
}
}
*/
@end
DreamSleep/DreamSleep/
TmpView
Controller.h
→
DreamSleep/DreamSleep/
Profile/SystemSet
Controller.h
查看文件 @
6666520
//
//
TmpView
Controller.h
//
SystemSet
Controller.h
// DreamSleep
//
// Created by peter on 2022/
3/30
.
// Created by peter on 2022/
4/14
.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
TmpViewController
:
UIViewController
/// 系统设置
@interface
SystemSetController
:
UIViewController
@end
...
...
DreamSleep/DreamSleep/Profile/SystemSetController.m
0 → 100644
查看文件 @
6666520
//
// SystemSetController.m
// DreamSleep
//
// Created by peter on 2022/4/14.
//
#import "SystemSetController.h"
#import "PrivacyViewController.h"
@interface
SystemSetController
()
@end
@implementation
SystemSetController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
navigationItem
.
title
=
@"系统设置"
;
self
.
view
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
UIButton
*
btn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
20
,
100
,
100
,
40
)];
[
btn
setTitle
:
@"用户协议"
forState
:
UIControlStateNormal
];
[
btn
setTitleColor
:
DSRed
forState
:
UIControlStateNormal
];
[
btn
addTarget
:
self
action
:
@selector
(
privicyAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
btn
];
}
-
(
void
)
privicyAction
{
[
self
.
navigationController
pushViewController
:[[
PrivacyViewController
alloc
]
initWithTitle
:
@"用户协议"
link
:[
NSURL
URLWithString
:
UserServiceAgreement
]
isDetail
:
YES
]
animated
:
YES
];
}
-
(
void
)
touchesBegan
:
(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
// 模拟切换黑夜模式
if
([
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNight
])
{
self
.
dk_manager
.
themeVersion
=
DKThemeVersionNormal
;
}
else
{
self
.
dk_manager
.
themeVersion
=
DKThemeVersionNight
;
}
}
#pragma mark - 导航栏日间、黑夜模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
@end
DreamSleep/DreamSleep/TmpViewController.m
deleted
100644 → 0
查看文件 @
3588475
//
// TmpViewController.m
// DreamSleep
//
// Created by peter on 2022/3/30.
//
#import "TmpViewController.h"
@interface
TmpViewController
()
@end
@implementation
TmpViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
}
-
(
void
)
touchesBegan
:
(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
DSLog
(
@"11111"
);
}
@end
DreamSleep/DreamSleep/ViewController.h
deleted
100644 → 0
查看文件 @
3588475
//
// ViewController.h
// DreamSleep
//
// Created by peter on 2022/3/29.
//
#import <UIKit/UIKit.h>
@interface
ViewController
:
UIViewController
@end
DreamSleep/DreamSleep/ViewController.m
deleted
100644 → 0
查看文件 @
3588475
//
// ViewController.m
// DreamSleep
//
// Created by peter on 2022/3/29.
//
#import "ViewController.h"
#import <DKNightVersion/DKNightVersion.h>
#import "TmpViewController.h"
@interface
ViewController
()
@end
@implementation
ViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
BG
);
DSKeyWindow
.
backgroundColor
=
DSRed
;
}
-
(
IBAction
)
changeAction
:
(
id
)
sender
{
if
([
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNight
])
{
[
self
.
dk_manager
dawnComing
];
}
else
if
([
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
])
{
self
.
dk_manager
.
themeVersion
=
@"RED"
;
}
else
{
[
self
.
dk_manager
nightFalling
];
}
}
-
(
IBAction
)
jumpAction
:
(
id
)
sender
{
TmpViewController
*
vc
=
[
TmpViewController
new
];
vc
.
view
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
BG
);
[
self
presentViewController
:
vc
animated
:
YES
completion
:
nil
];
}
-
(
void
)
touchesBegan
:
(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
DSLog
(
@"2222"
);
}
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论