Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
256a1479
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
256a1479
编写于
12月 29, 2018
作者:
Y
yixiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
适配XR、XS 、XS MAX
上级
62ff21fa
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
41 addition
and
106 deletion
+41
-106
iOS/DoraemonKit/Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
...Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
+2
-2
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
+6
-6
iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.h
...DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.h
+2
-0
iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.m
...DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.m
+20
-0
iOS/DoraemonKit/Src/Core/Plugin/CPU/Function/DoraemonCPUOscillogramViewController.m
...lugin/CPU/Function/DoraemonCPUOscillogramViewController.m
+2
-2
iOS/DoraemonKit/Src/Core/Plugin/FPS/Function/DoraemonFPSOscillogramViewController.m
...lugin/FPS/Function/DoraemonFPSOscillogramViewController.m
+2
-2
iOS/DoraemonKit/Src/Core/Plugin/Memory/Function/DoraemonMemoryOscillogramViewController.m
...Memory/Function/DoraemonMemoryOscillogramViewController.m
+2
-2
iOS/DoraemonKit/Src/Core/Plugin/NetFlow/Function/View/DoraemonNetFlowOscillogramViewController.m
.../Function/View/DoraemonNetFlowOscillogramViewController.m
+2
-2
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.h
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.h
+0
-16
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.m
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.m
+0
-71
iOS/DoraemonKitDemo/Podfile.lock
iOS/DoraemonKitDemo/Podfile.lock
+3
-3
未找到文件。
iOS/DoraemonKit/Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
浏览文件 @
256a1479
...
...
@@ -46,7 +46,7 @@
}
-
(
BOOL
)
pointInside
:(
CGPoint
)
point
withEvent
:(
UIEvent
*
)
event
{
if
(
point
.
x
>
DoraemonScreenWidth
-
kDoraemonSizeFrom750
(
60
)
&&
point
.
y
<
kDoraemonSizeFrom750
(
60
))
{
if
(
point
.
x
>
DoraemonScreenWidth
-
kDoraemonSizeFrom750
(
60
)
&&
point
.
y
<
kDoraemonSizeFrom750
(
60
)
+
IPHONE_TOPSENSOR_HEIGHT
)
{
return
[
super
pointInside
:
point
withEvent
:
event
];
}
return
NO
;
...
...
@@ -54,7 +54,7 @@
-
(
void
)
show
{
self
.
hidden
=
NO
;
self
.
frame
=
CGRectMake
(
0
,
0
,
DoraemonScreenWidth
,
kDoraemonSizeFrom750
(
480
));
self
.
frame
=
CGRectMake
(
0
,
0
,
DoraemonScreenWidth
,
kDoraemonSizeFrom750
(
480
)
+
IPHONE_TOPSENSOR_HEIGHT
);
[
_vc
startRecord
];
}
...
...
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
浏览文件 @
256a1479
...
...
@@ -9,7 +9,7 @@
#ifndef DoraemonDefine_h
#define DoraemonDefine_h
#import "Doraemon
DeviceManager
.h"
#import "Doraemon
AppInfoUtil
.h"
#import "UIColor+Doraemon.h"
#import "UIView+Doraemon.h"
#import "UIImage+Doraemon.h"
...
...
@@ -22,11 +22,11 @@
//根据750*1334分辨率计算size
#define kDoraemonSizeFrom750(x) ((x)*DoraemonScreenWidth/750)
#define IS_IPHONE_X
[DoraemonDeviceManager is_IPhone_X
]
#define IPHONE_NAVIGATIONBAR_HEIGHT (IS_IPHONE_X ? 88 : 64)
#define IPHONE_STATUSBAR_HEIGHT (IS_IPHONE_X ? 44 : 20)
#define IPHONE_SAFEBOTTOMAREA_HEIGHT (IS_IPHONE_X ? 34 : 0)
#define IPHONE_TOPSENSOR_HEIGHT (IS_IPHONE_X ? 32 : 0)
#define IS_IPHONE_X
_Series [DoraemonAppInfoUtil isIPhoneXSeries
]
#define IPHONE_NAVIGATIONBAR_HEIGHT (IS_IPHONE_X
_Series
? 88 : 64)
#define IPHONE_STATUSBAR_HEIGHT (IS_IPHONE_X
_Series
? 44 : 20)
#define IPHONE_SAFEBOTTOMAREA_HEIGHT (IS_IPHONE_X
_Series
? 34 : 0)
#define IPHONE_TOPSENSOR_HEIGHT (IS_IPHONE_X
_Series
? 32 : 0)
#define DoraemonShowPluginNotification @"DoraemonShowPluginNotification"
...
...
iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.h
浏览文件 @
256a1479
...
...
@@ -11,6 +11,8 @@
+
(
NSString
*
)
iphoneType
;
+
(
BOOL
)
isIPhoneXSeries
;
+
(
NSString
*
)
locationAuthority
;
+
(
NSString
*
)
pushAuthority
;
...
...
iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.m
浏览文件 @
256a1479
...
...
@@ -52,10 +52,30 @@
if
([
platform
isEqualToString
:
@"iPhone10,5"
])
return
@"iPhone 8 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone10,3"
])
return
@"iPhone X"
;
if
([
platform
isEqualToString
:
@"iPhone10,6"
])
return
@"iPhone X"
;
if
([
platform
isEqualToString
:
@"iPhone11,8"
])
return
@"iPhone XR"
;
if
([
platform
isEqualToString
:
@"iPhone11,2"
])
return
@"iPhone XS"
;
if
([
platform
isEqualToString
:
@"iPhone11,4"
])
return
@"iPhone XS MAX"
;
if
([
platform
isEqualToString
:
@"iPhone11,6"
])
return
@"iPhone XS MAX"
;
return
platform
;
}
+
(
BOOL
)
isIPhoneXSeries
{
BOOL
iPhoneXSeries
=
NO
;
if
(
UIDevice
.
currentDevice
.
userInterfaceIdiom
!=
UIUserInterfaceIdiomPhone
)
{
return
iPhoneXSeries
;
}
if
(
@available
(
iOS
11
.
0
,
*
))
{
UIWindow
*
mainWindow
=
[[[
UIApplication
sharedApplication
]
delegate
]
window
];
if
(
mainWindow
.
safeAreaInsets
.
bottom
>
0
.
0
)
{
iPhoneXSeries
=
YES
;
}
}
return
iPhoneXSeries
;
}
+
(
NSString
*
)
locationAuthority
{
NSString
*
authority
=
@""
;
if
([
CLLocationManager
locationServicesEnabled
])
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/CPU/Function/DoraemonCPUOscillogramViewController.m
浏览文件 @
256a1479
...
...
@@ -36,11 +36,11 @@
titleLabel
.
textColor
=
[
UIColor
whiteColor
];
[
self
.
view
addSubview
:
titleLabel
];
[
titleLabel
sizeToFit
];
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
IPHONE_TOPSENSOR_HEIGHT
+
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
UIButton
*
closeBtn
=
[[
UIButton
alloc
]
init
];
[
closeBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close_white"
]
forState
:
UIControlStateNormal
];
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
0
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
IPHONE_TOPSENSOR_HEIGHT
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
closeBtn
];
...
...
iOS/DoraemonKit/Src/Core/Plugin/FPS/Function/DoraemonFPSOscillogramViewController.m
浏览文件 @
256a1479
...
...
@@ -36,11 +36,11 @@
titleLabel
.
textColor
=
[
UIColor
whiteColor
];
[
self
.
view
addSubview
:
titleLabel
];
[
titleLabel
sizeToFit
];
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
IPHONE_TOPSENSOR_HEIGHT
+
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
UIButton
*
closeBtn
=
[[
UIButton
alloc
]
init
];
[
closeBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close_white"
]
forState
:
UIControlStateNormal
];
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
0
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
IPHONE_TOPSENSOR_HEIGHT
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
closeBtn
];
...
...
iOS/DoraemonKit/Src/Core/Plugin/Memory/Function/DoraemonMemoryOscillogramViewController.m
浏览文件 @
256a1479
...
...
@@ -36,11 +36,11 @@
titleLabel
.
textColor
=
[
UIColor
whiteColor
];
[
self
.
view
addSubview
:
titleLabel
];
[
titleLabel
sizeToFit
];
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
IPHONE_TOPSENSOR_HEIGHT
+
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
UIButton
*
closeBtn
=
[[
UIButton
alloc
]
init
];
[
closeBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close_white"
]
forState
:
UIControlStateNormal
];
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
0
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
IPHONE_TOPSENSOR_HEIGHT
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
closeBtn
];
...
...
iOS/DoraemonKit/Src/Core/Plugin/NetFlow/Function/View/DoraemonNetFlowOscillogramViewController.m
浏览文件 @
256a1479
...
...
@@ -35,11 +35,11 @@
titleLabel
.
textColor
=
[
UIColor
whiteColor
];
[
self
.
view
addSubview
:
titleLabel
];
[
titleLabel
sizeToFit
];
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
titleLabel
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
20
),
IPHONE_TOPSENSOR_HEIGHT
+
kDoraemonSizeFrom750
(
10
),
titleLabel
.
doraemon_width
,
titleLabel
.
doraemon_height
);
UIButton
*
closeBtn
=
[[
UIButton
alloc
]
init
];
[
closeBtn
setImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close_white"
]
forState
:
UIControlStateNormal
];
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
0
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
closeBtn
.
frame
=
CGRectMake
(
self
.
view
.
doraemon_width
-
kDoraemonSizeFrom750
(
60
),
IPHONE_TOPSENSOR_HEIGHT
,
kDoraemonSizeFrom750
(
60
),
kDoraemonSizeFrom750
(
60
));
[
closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
closeBtn
];
...
...
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.h
已删除
100644 → 0
浏览文件 @
62ff21fa
//
// DoraemonDeviceManager.h
// CocoaLumberjack
//
// Created by yixiang on 2017/12/20.
//
#import <Foundation/Foundation.h>
@interface
DoraemonDeviceManager
:
NSObject
//获取设备名称
+
(
NSString
*
)
deviceName
;
+
(
BOOL
)
is_IPhone_X
;
@end
iOS/DoraemonKit/Src/Core/Util/DoraemonDeviceManager.m
已删除
100644 → 0
浏览文件 @
62ff21fa
//
// DoraemonDeviceManager.m
// CocoaLumberjack
//
// Created by yixiang on 2017/12/20.
//
#import "DoraemonDeviceManager.h"
#import <sys/utsname.h>
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#define kIPhoneXHeight 812.
@implementation
DoraemonDeviceManager
+
(
NSString
*
)
deviceName
{
struct
utsname
systemInfo
;
uname
(
&
systemInfo
);
NSString
*
platform
=
[
NSString
stringWithCString
:
systemInfo
.
machine
encoding
:
NSUTF8StringEncoding
];
//Simulator
if
([
platform
isEqualToString
:
@"i386"
]){
if
(
fabs
(
kScreenHeight
-
kIPhoneXHeight
)
<
0
.
1
)
return
@"iPhone X"
;
return
@"Simulator"
;
}
if
([
platform
isEqualToString
:
@"x86_64"
]){
if
(
fabs
(
kScreenHeight
-
kIPhoneXHeight
)
<
0
.
1
)
return
@"iPhone X"
;
return
@"Simulator"
;
}
//iPhone
if
([
platform
isEqualToString
:
@"iPhone1,1"
])
return
@"iPhone 1G"
;
if
([
platform
isEqualToString
:
@"iPhone1,2"
])
return
@"iPhone 3G"
;
if
([
platform
isEqualToString
:
@"iPhone2,1"
])
return
@"iPhone 3GS"
;
if
([
platform
isEqualToString
:
@"iPhone3,1"
])
return
@"iPhone 4"
;
if
([
platform
isEqualToString
:
@"iPhone3,2"
])
return
@"iPhone 4"
;
if
([
platform
isEqualToString
:
@"iPhone4,1"
])
return
@"iPhone 4S"
;
if
([
platform
isEqualToString
:
@"iPhone5,1"
])
return
@"iPhone 5"
;
if
([
platform
isEqualToString
:
@"iPhone5,2"
])
return
@"iPhone 5"
;
if
([
platform
isEqualToString
:
@"iPhone5,3"
])
return
@"iPhone 5C"
;
if
([
platform
isEqualToString
:
@"iPhone5,4"
])
return
@"iPhone 5C"
;
if
([
platform
isEqualToString
:
@"iPhone6,1"
])
return
@"iPhone 5S"
;
if
([
platform
isEqualToString
:
@"iPhone6,2"
])
return
@"iPhone 5S"
;
if
([
platform
isEqualToString
:
@"iPhone7,1"
])
return
@"iPhone 6 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone7,2"
])
return
@"iPhone 6"
;
if
([
platform
isEqualToString
:
@"iPhone8,1"
])
return
@"iPhone 6S"
;
if
([
platform
isEqualToString
:
@"iPhone8,2"
])
return
@"iPhone 6S Plus"
;
if
([
platform
isEqualToString
:
@"iPhone8,4"
])
return
@"iPhone SE"
;
if
([
platform
isEqualToString
:
@"iPhone9,1"
])
return
@"iPhone 7"
;
if
([
platform
isEqualToString
:
@"iPhone9,3"
])
return
@"iPhone 7"
;
if
([
platform
isEqualToString
:
@"iPhone9,2"
])
return
@"iPhone 7 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone9,4"
])
return
@"iPhone 7 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone10,1"
])
return
@"iPhone 8"
;
if
([
platform
isEqualToString
:
@"iPhone10.4"
])
return
@"iPhone 8"
;
if
([
platform
isEqualToString
:
@"iPhone10,2"
])
return
@"iPhone 8 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone10,5"
])
return
@"iPhone 8 Plus"
;
if
([
platform
isEqualToString
:
@"iPhone10,3"
])
return
@"iPhone X"
;
if
([
platform
isEqualToString
:
@"iPhone10,6"
])
return
@"iPhone X"
;
return
platform
;
}
+
(
BOOL
)
is_IPhone_X
{
NSString
*
platform
=
[
self
deviceName
];
if
([
platform
isEqualToString
:
@"iPhone X"
])
{
return
YES
;
}
return
NO
;
}
@end
iOS/DoraemonKitDemo/Podfile.lock
浏览文件 @
256a1479
...
...
@@ -27,13 +27,13 @@ PODS:
- CocoaLumberjack/Default (3.4.2)
- CocoaLumberjack/Extensions (3.4.2):
- CocoaLumberjack/Default
- DoraemonKit/Core (1.1.
2
):
- DoraemonKit/Core (1.1.
3
):
- AFNetworking
- BSBacktraceLogger
- fishhook
- PNChart
- "UITextView+Placeholder"
- DoraemonKit/WithLogger (1.1.
2
):
- DoraemonKit/WithLogger (1.1.
3
):
- AFNetworking
- BSBacktraceLogger
- CocoaLumberjack
...
...
@@ -69,7 +69,7 @@ SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
BSBacktraceLogger: 06b983ee93a9f87d957960e9c73d660d5966b447
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
DoraemonKit:
9249e697823e13c942ea936691354142f5174b70
DoraemonKit:
07a69bc4fe19b999ceff9615cd96664a8ec27eb6
fishhook: ea19933abfe8f2f52c55fd8b6e2718467d3ebc89
PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2
UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录