Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
40463a09
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
大约 1 年 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
40463a09
编写于
8月 30, 2019
作者:
C
CC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CCAutoTag push : 使用传入位置,解决遮挡关键区域,减少频繁移动
上级
b44d6946
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
48 addition
and
6 deletion
+48
-6
Doc/iOS_cn_guide.md
Doc/iOS_cn_guide.md
+5
-2
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
+3
-0
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.h
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.h
+3
-0
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
+12
-1
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.h
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.h
+3
-0
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.m
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.m
+21
-3
iOS/DoraemonKitDemo/DoraemonKitDemo/DoKitAppDelegate.m
iOS/DoraemonKitDemo/DoraemonKitDemo/DoKitAppDelegate.m
+1
-0
未找到文件。
Doc/iOS_cn_guide.md
浏览文件 @
40463a09
...
...
@@ -28,14 +28,17 @@ MockGPS存在一些兼容性问题(绝大部分情况是好的,问题详见[
### 2、使用DoraemonKit内置工具集的接入方式
在App启动的时候添加一下代码
```
```
objective-c
#ifdef DEBUG
#import <DoraemonKit/DoraemonManager.h>
#endif
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#ifdef DEBUG
//默认
[[DoraemonManager shareInstance] install];
// 或者使用传入位置,解决遮挡关键区域,减少频繁移动
//[[DoraemonManager shareInstance] installWithStartingPosition:CGPointMake(66, 66)];
#endif
}
```
...
...
@@ -57,7 +60,7 @@ MockGPS存在一些兼容性问题(绝大部分情况是好的,问题详见[
}
@end
```
第二步:在Doraemon初始化的地方添加第一步中添加的“环境切换”插件
...
...
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
浏览文件 @
40463a09
...
...
@@ -20,6 +20,9 @@
#define DoraemonScreenWidth [UIScreen mainScreen].bounds.size.width
#define DoraemonScreenHeight [UIScreen mainScreen].bounds.size.height
//Doraemon默认位置
#define DoraemonStartingPosition CGPointMake(0, DoraemonScreenHeight/3.0)
//根据750*1334分辨率计算size
#define kDoraemonSizeFrom750(x) ((x)*DoraemonScreenWidth/750)
// 如果横屏显示
...
...
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.h
浏览文件 @
40463a09
...
...
@@ -10,4 +10,7 @@
@interface
DoraemonEntryView
:
UIWindow
// 定制位置
@property
(
nonatomic
)
CGPoint
startingPosition
;
@end
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
浏览文件 @
40463a09
...
...
@@ -26,7 +26,18 @@
-
(
instancetype
)
init
{
_kEntryViewSize
=
58
;
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
DoraemonScreenHeight
/
3
,
_kEntryViewSize
,
_kEntryViewSize
)];
CGFloat
x
=
self
.
startingPosition
.
x
;
CGFloat
y
=
self
.
startingPosition
.
y
;
CGPoint
defaultPosition
=
DoraemonStartingPosition
;
if
(
x
<
0
||
x
>
(
DoraemonScreenWidth
-
_kEntryViewSize
))
{
x
=
defaultPosition
.
x
;
}
if
(
y
<
0
||
y
>
(
DoraemonScreenHeight
-
_kEntryViewSize
))
{
y
=
defaultPosition
.
y
;
}
self
=
[
super
initWithFrame
:
CGRectMake
(
x
,
y
,
_kEntryViewSize
,
_kEntryViewSize
)];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
windowLevel
=
UIWindowLevelStatusBar
+
100
.
f
;
...
...
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.h
浏览文件 @
40463a09
...
...
@@ -90,6 +90,9 @@ typedef NS_ENUM(NSUInteger, DoraemonManagerPluginType) {
-
(
void
)
install
;
// 定制起始位置 | 适用正好挡住关键位置
-
(
void
)
installWithStartingPosition
:(
CGPoint
)
position
;
-
(
void
)
installWithCustomBlock
:(
void
(
^
)(
void
))
customBlock
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArray
;
...
...
iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.m
浏览文件 @
40463a09
...
...
@@ -65,6 +65,9 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
@property
(
nonatomic
,
assign
)
BOOL
hasInstall
;
// 定制位置
@property
(
nonatomic
)
CGPoint
startingPosition
;
@end
@implementation
DoraemonManager
...
...
@@ -79,6 +82,16 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
}
-
(
void
)
install
{
//启用默认位置
CGPoint
defaultPosition
=
DoraemonStartingPosition
;
// startingPosition = CGPointMake(0, DoraemonScreenHeight/3);
// startingPosition = CGPointMake(0, 0 - 1);
// startingPosition = CGPointMake(100, 100);
[
self
installWithStartingPosition
:
defaultPosition
];
}
-
(
void
)
installWithStartingPosition
:(
CGPoint
)
position
{
_startingPosition
=
position
;
[
self
installWithCustomBlock
:
^
{
//什么也没发生
}];
...
...
@@ -102,7 +115,7 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
[
self
initData
];
customBlock
();
[
self
initEntry
];
[
self
initEntry
:
self
.
startingPosition
];
//根据开关判断是否收集Crash日志
if
([[
DoraemonCacheManager
sharedInstance
]
crashSwitch
])
{
...
...
@@ -237,8 +250,13 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
/**
初始化工具入口
*/
-
(
void
)
initEntry
{
_entryView
=
[[
DoraemonEntryView
alloc
]
init
];
-
(
void
)
initEntry
:(
CGPoint
)
startingPosition
{
// _entryView = [[DoraemonEntryView alloc] init];
// _entryView = [[DoraemonEntryView alloc] init];
_entryView
=
[
DoraemonEntryView
alloc
];
_entryView
.
startingPosition
=
startingPosition
;
_entryView
=
[
_entryView
init
];
[
_entryView
makeKeyAndVisible
];
}
...
...
iOS/DoraemonKitDemo/DoraemonKitDemo/DoKitAppDelegate.m
浏览文件 @
40463a09
...
...
@@ -36,6 +36,7 @@
[
DoraemonManager
shareInstance
].
bigImageDetectionSize
=
10
*
1024
;
//大图检测只检测10K以上的
[
DoraemonManager
shareInstance
].
startClass
=
@"DoKitAppDelegate"
;
[[
DoraemonManager
shareInstance
]
install
];
//[[DoraemonManager shareInstance] installWithStartingPosition:CGPointMake(66, 66)];
[[
DoraemonManager
shareInstance
]
addANRBlock
:
^
(
NSDictionary
*
anrDic
)
{
NSLog
(
@"anrDic == %@"
,
anrDic
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录