Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
f4da3a2b
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
f4da3a2b
编写于
4月 25, 2019
作者:
Y
yixiangboy
提交者:
GitHub
4月 25, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #150 from HuginChen/master
解决 issues105 横屏APP还是有问题
上级
7317f810
421dd815
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
121 addition
and
87 deletion
+121
-87
iOS/DoraemonKit/Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
...Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
+1
-1
iOS/DoraemonKit/Src/Core/CommonUI/StateBar/DoraemonStateBar.m
...DoraemonKit/Src/Core/CommonUI/StateBar/DoraemonStateBar.m
+1
-1
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.h
...onKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.h
+4
-1
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.m
...onKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.m
+72
-0
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualMagnifierWindow.m
.../Src/Core/CommonUI/Visual/DoraemonVisualMagnifierWindow.m
+1
-1
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
+4
-1
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
+1
-1
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/ColorPick/Function/DoraemonColorPickInfoWindow.m
...e/Plugin/ColorPick/Function/DoraemonColorPickInfoWindow.m
+1
-3
iOS/DoraemonKit/Src/Core/Plugin/ColorPick/Function/DoraemonColorPickWindow.m
.../Core/Plugin/ColorPick/Function/DoraemonColorPickWindow.m
+1
-1
iOS/DoraemonKit/Src/Core/Plugin/ViewAlign/Function/DoraemonViewAlignView.m
...rc/Core/Plugin/ViewAlign/Function/DoraemonViewAlignView.m
+4
-22
iOS/DoraemonKit/Src/Core/Plugin/ViewCheck/Function/DoraemonViewCheckView.m
...rc/Core/Plugin/ViewCheck/Function/DoraemonViewCheckView.m
+30
-54
未找到文件。
iOS/DoraemonKit/Src/Core/CommonUI/Oscillogram/DoraemonOscillogramWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -28,7 +28,7 @@
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
00
.
f
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
self
.
backgroundColor
=
[
UIColor
doraemon_colorWithHex
:
0x000000
andAlpha
:
0
.
33
];
[
self
addRootVc
];
...
...
iOS/DoraemonKit/Src/Core/CommonUI/StateBar/DoraemonStateBar.m
浏览文件 @
f4da3a2b
...
...
@@ -29,7 +29,7 @@
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
00
.
f
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
self
.
backgroundColor
=
[
UIColor
doraemon_colorWithString
:
@"#427dbe"
];
_contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectZero
];
...
...
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.h
浏览文件 @
f4da3a2b
...
...
@@ -10,7 +10,10 @@
NS_ASSUME_NONNULL_BEGIN
@interface
DoraemonVisualInfoWindow
:
UIWindow
/** 显示的文本 */
@property
(
nonatomic
,
copy
)
NSString
*
infoText
;
/** 显示的属性文本 */
@property
(
nonatomic
,
copy
)
NSAttributedString
*
infoAttributedText
;
@end
NS_ASSUME_NONNULL_END
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualInfoWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -8,8 +8,78 @@
#import "DoraemonVisualInfoWindow.h"
#import "DoraemonDefine.h"
@interface
DoraemonVisualInfoViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
UIButton
*
closeBtn
;
@property
(
nonatomic
,
strong
)
UILabel
*
infoLabel
;
@end
@implementation
DoraemonVisualInfoViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
initUI
];
}
-
(
void
)
initUI
{
// 视图加载完成之前拿不到当前window,所以这里等待 UI 线程执行完成
dispatch_async
(
dispatch_get_main_queue
(),
^
{
CGSize
viewSize
=
self
.
view
.
window
.
bounds
.
size
;
CGFloat
closeWidth
=
kDoraemonSizeFrom750
(
44
);
CGFloat
closeHeight
=
kDoraemonSizeFrom750
(
44
);
_closeBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
viewSize
.
width
-
closeWidth
-
kDoraemonSizeFrom750
(
16
),
kDoraemonSizeFrom750
(
16
),
closeWidth
,
closeHeight
)];
[
_closeBtn
setBackgroundImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close"
]
forState
:
UIControlStateNormal
];
[
_closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClicked
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
view
addSubview
:
_closeBtn
];
_infoLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
32
),
0
,
viewSize
.
width
-
kDoraemonSizeFrom750
(
32
+
16
)
-
closeWidth
,
viewSize
.
height
)];
_infoLabel
.
backgroundColor
=
[
UIColor
clearColor
];
_infoLabel
.
textColor
=
[
UIColor
doraemon_black_1
];
_infoLabel
.
font
=
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750
(
24
)];
_infoLabel
.
numberOfLines
=
0
;
[
self
.
view
addSubview
:
_infoLabel
];
[(
id
)
self
.
view
.
window
setInfoLabel
:
_infoLabel
];
});
}
#pragma mark - Actions
-
(
void
)
closeBtnClicked
:(
id
)
sender
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
DoraemonClosePluginNotification
object
:
nil
userInfo
:
nil
];
}
-
(
void
)
viewWillTransitionToSize
:(
CGSize
)
size
withTransitionCoordinator
:(
id
<
UIViewControllerTransitionCoordinator
>
)
coordinator
{
[
super
viewWillTransitionToSize
:
size
withTransitionCoordinator
:
coordinator
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
size
.
height
<
size
.
width
)
{
self
.
view
.
window
.
frame
=
CGRectMake
(
49
,
20
,
size
.
height
,
size
.
width
);
}
else
{
self
.
view
.
window
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
30
),
DoraemonScreenHeight
-
_infoLabel
.
frame
.
size
.
height
-
kDoraemonSizeFrom750
(
30
),
size
.
height
,
size
.
width
);
}
});
}
@end
@interface
DoraemonVisualInfoWindow
()
@property
(
nonatomic
,
weak
)
UILabel
*
infoLabel
;
@end
@implementation
DoraemonVisualInfoWindow
#pragma mark - set
-
(
void
)
setInfoText
:(
NSString
*
)
infoText
{
_infoText
=
infoText
;
_infoLabel
.
text
=
infoText
;
}
-
(
void
)
setInfoAttributedText
:(
NSAttributedString
*
)
infoAttributedText
{
_infoAttributedText
=
infoAttributedText
;
_infoLabel
.
attributedText
=
infoAttributedText
;
}
#pragma mark - Lifecycle
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
...
...
@@ -26,6 +96,8 @@
self
.
layer
.
borderWidth
=
1
.;
self
.
layer
.
borderColor
=
[
UIColor
doraemon_colorWithHex
:
0x999999
andAlpha
:
0
.
2
].
CGColor
;
self
.
windowLevel
=
UIWindowLevelAlert
;
[[
DoraemonVisualInfoViewController
alloc
]
init
];
self
.
rootViewController
=
[[
DoraemonVisualInfoViewController
alloc
]
init
];
UIPanGestureRecognizer
*
pan
=
[[
UIPanGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
pan
:
)];
[
self
addGestureRecognizer
:
pan
];
...
...
iOS/DoraemonKit/Src/Core/CommonUI/Visual/DoraemonVisualMagnifierWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -25,7 +25,7 @@
self
.
layer
.
delegate
=
self
;
self
.
layer
.
borderWidth
=
1
;
self
.
layer
.
borderColor
=
[[
UIColor
clearColor
]
CGColor
];
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
self
.
layer
.
contentsScale
=
[[
UIScreen
mainScreen
]
scale
];
}
return
self
;
...
...
iOS/DoraemonKit/Src/Core/Define/DoraemonDefine.h
浏览文件 @
f4da3a2b
...
...
@@ -20,7 +20,10 @@
#define DoraemonScreenHeight [UIScreen mainScreen].bounds.size.height
//根据750*1334分辨率计算size
#define kDoraemonSizeFrom750(x) ((x)*DoraemonScreenWidth/750)
#define kDoraemonSizeFrom750(x) ((x)*DoraemonScreenWidth/750)
// 如果横屏显示
#define kDoraemonSizeFrom750_Landscape(x) UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation) ? ((x)*DoraemonScreenHeight/750) : kDoraemonSizeFrom750(x)
#define IS_IPHONE_X_Series [DoraemonAppInfoUtil isIPhoneXSeries]
#define IPHONE_NAVIGATIONBAR_HEIGHT (IS_IPHONE_X_Series ? 88 : 64)
...
...
iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
浏览文件 @
f4da3a2b
...
...
@@ -31,7 +31,7 @@
self
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
00
.
f
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
NSString
*
version
=
[
UIDevice
currentDevice
].
systemVersion
;
if
(
version
.
doubleValue
>=
10
.
0
)
{
if
(
!
self
.
rootViewController
)
{
...
...
iOS/DoraemonKit/Src/Core/Entry/Home/DoraemonHomeWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -24,7 +24,7 @@
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
windowLevel
=
UIWindowLevelStatusBar
+
50
.
f
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
self
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
hidden
=
YES
;
}
...
...
iOS/DoraemonKit/Src/Core/Plugin/ColorPick/Function/DoraemonColorPickInfoWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -87,9 +87,7 @@
CGPoint
centerPoint
=
CGPointMake
(
newX
,
newY
);
panView
.
center
=
centerPoint
;
}
#pragma mark - Delegate
#pragma mark DoraemonColorPickInfoViewDelegate
-
(
void
)
closeBtnClicked
:(
id
)
sender
onColorPickInfoView
:(
DoraemonColorPickInfoView
*
)
colorPickInfoView
{
...
...
iOS/DoraemonKit/Src/Core/Plugin/ColorPick/Function/DoraemonColorPickWindow.m
浏览文件 @
f4da3a2b
...
...
@@ -47,7 +47,7 @@ static CGFloat const kColorPickWindowSize = 150;
self
=
[
super
initWithFrame
:
CGRectMake
(
DoraemonScreenWidth
/
2
-
kColorPickWindowSize
/
2
,
DoraemonScreenHeight
/
2
-
kColorPickWindowSize
/
2
,
kColorPickWindowSize
,
kColorPickWindowSize
)];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
1
.
f
;
self
.
windowLevel
=
UIWindowLevelStatusBar
+
1
.
f
;
if
(
!
self
.
rootViewController
)
{
self
.
rootViewController
=
[[
UIViewController
alloc
]
init
];
}
...
...
iOS/DoraemonKit/Src/Core/Plugin/ViewAlign/Function/DoraemonViewAlignView.m
浏览文件 @
f4da3a2b
...
...
@@ -20,9 +20,7 @@ static CGFloat const kViewCheckSize = 62;
@property
(
nonatomic
,
strong
)
UILabel
*
topLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
rightLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
bottomLabel
;
@property
(
nonatomic
,
strong
)
DoraemonVisualInfoWindow
*
infoWindow
;
@property
(
nonatomic
,
strong
)
UILabel
*
infoLbl
;
@property
(
nonatomic
,
strong
)
UIButton
*
closeBtn
;
@property
(
nonatomic
,
strong
)
DoraemonVisualInfoWindow
*
infoWindow
;
@end
...
...
@@ -90,19 +88,7 @@ static CGFloat const kViewCheckSize = 62;
_infoWindow
=
[[
DoraemonVisualInfoWindow
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
30
),
DoraemonScreenHeight
-
kDoraemonSizeFrom750
(
100
)
-
kDoraemonSizeFrom750
(
30
),
DoraemonScreenWidth
-
2
*
kDoraemonSizeFrom750
(
30
),
kDoraemonSizeFrom750
(
100
))];
CGFloat
closeWidth
=
kDoraemonSizeFrom750
(
44
);
CGFloat
closeHeight
=
kDoraemonSizeFrom750
(
44
);
_closeBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
_infoWindow
.
bounds
.
size
.
width
-
closeWidth
-
kDoraemonSizeFrom750
(
32
),
(
_infoWindow
.
bounds
.
size
.
height
-
closeHeight
)
/
2
.
0
,
closeWidth
,
closeHeight
)];
[
_closeBtn
setBackgroundImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close"
]
forState
:
UIControlStateNormal
];
[
_closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClicked
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_infoWindow
addSubview
:
_closeBtn
];
_infoLbl
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
32
),
0
,
_infoWindow
.
bounds
.
size
.
width
-
2
*
kDoraemonSizeFrom750
(
32
)
-
_closeBtn
.
doraemon_width
,
_infoWindow
.
bounds
.
size
.
height
)];
_infoLbl
.
backgroundColor
=
[
UIColor
clearColor
];
_infoLbl
.
textColor
=
[
UIColor
doraemon_black_1
];
_infoLbl
.
font
=
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750
(
24
)];
[
self
configInfoLblText
];
[
_infoWindow
addSubview
:
_infoLbl
];
[
self
configInfoLblText
];
}
return
self
;
}
...
...
@@ -150,13 +136,9 @@ static CGFloat const kViewCheckSize = 62;
}
-
(
void
)
configInfoLblText
{
_infoLbl
.
text
=
[
NSString
stringWithFormat
:
@"位置:左%@ 右%@ 上%@ 下%@"
,
_leftLabel
.
text
,
_rightLabel
.
text
,
_topLabel
.
text
,
_bottomLabel
.
text
];
}
-
(
void
)
closeBtnClicked
:(
id
)
sender
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
DoraemonClosePluginNotification
object
:
nil
userInfo
:
nil
];
_infoWindow
.
infoText
=
[
NSString
stringWithFormat
:
@"位置:左%@ 右%@ 上%@ 下%@"
,
_leftLabel
.
text
,
_rightLabel
.
text
,
_topLabel
.
text
,
_bottomLabel
.
text
];
}
-
(
void
)
show
{
_infoWindow
.
hidden
=
NO
;
...
...
iOS/DoraemonKit/Src/Core/Plugin/ViewCheck/Function/DoraemonViewCheckView.m
浏览文件 @
f4da3a2b
...
...
@@ -15,9 +15,7 @@ static CGFloat const kViewCheckSize = 62;
@interface
DoraemonViewCheckView
()
@property
(
nonatomic
,
strong
)
UIView
*
viewBound
;
//当前需要探测的view的边框
@property
(
nonatomic
,
strong
)
DoraemonVisualInfoWindow
*
viewInfoWindow
;
//顶部被探测到的view的信息显示的UIwindow
@property
(
nonatomic
,
strong
)
UILabel
*
viewInfoLabel
;
//顶部被探测到的view的信息显示
@property
(
nonatomic
,
strong
)
UIButton
*
closeBtn
;
@property
(
nonatomic
,
strong
)
DoraemonVisualInfoWindow
*
infoWindow
;
//顶部被探测到的view的信息显示的UIwindow
@property
(
nonatomic
,
assign
)
CGFloat
left
;
@property
(
nonatomic
,
assign
)
CGFloat
top
;
...
...
@@ -46,32 +44,12 @@ static CGFloat const kViewCheckSize = 62;
_viewBound
.
layer
.
borderColor
=
[
UIColor
doraemon_colorWithHex
:
0xCC3A4B
].
CGColor
;
_viewBound
.
layer
.
zPosition
=
FLT_MAX
;
_viewInfoWindow
=
[[
DoraemonVisualInfoWindow
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
30
),
DoraemonScreenHeight
-
kDoraemonSizeFrom750
(
180
)
-
kDoraemonSizeFrom750
(
30
),
DoraemonScreenWidth
-
2
*
kDoraemonSizeFrom750
(
30
),
kDoraemonSizeFrom750
(
180
))];
[
_viewInfoWindow
makeKeyAndVisible
];
_viewInfoWindow
.
hidden
=
YES
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
.
window
makeKeyAndVisible
];
//将keyWindow还是交给原来那个
});
CGFloat
closeWidth
=
kDoraemonSizeFrom750
(
44
);
CGFloat
closeHeight
=
kDoraemonSizeFrom750
(
44
);
_closeBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
_viewInfoWindow
.
bounds
.
size
.
width
-
closeWidth
-
kDoraemonSizeFrom750
(
32
),
kDoraemonSizeFrom750
(
18
),
closeWidth
,
closeHeight
)];
[
_closeBtn
setBackgroundImage
:[
UIImage
doraemon_imageNamed
:
@"doraemon_close"
]
forState
:
UIControlStateNormal
];
[
_closeBtn
addTarget
:
self
action
:
@selector
(
closeBtnClicked
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_viewInfoWindow
addSubview
:
_closeBtn
];
_viewInfoLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
32
),
kDoraemonSizeFrom750
(
30
),
_viewInfoWindow
.
bounds
.
size
.
width
-
2
*
kDoraemonSizeFrom750
(
32
)
-
_closeBtn
.
doraemon_width
,
_viewInfoWindow
.
bounds
.
size
.
height
-
2
*
kDoraemonSizeFrom750
(
30
))];
_viewInfoLabel
.
numberOfLines
=
0
;
_viewInfoLabel
.
backgroundColor
=
[
UIColor
clearColor
];
_viewInfoLabel
.
textColor
=
[
UIColor
doraemon_black_1
];
_viewInfoLabel
.
font
=
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750
(
24
)];
[
_viewInfoWindow
addSubview
:
_viewInfoLabel
];
_infoWindow
=
[[
DoraemonVisualInfoWindow
alloc
]
initWithFrame
:
CGRectMake
(
kDoraemonSizeFrom750
(
30
),
DoraemonScreenHeight
-
kDoraemonSizeFrom750
(
180
)
-
kDoraemonSizeFrom750
(
30
),
DoraemonScreenWidth
-
2
*
kDoraemonSizeFrom750
(
30
),
kDoraemonSizeFrom750
(
180
))];
}
return
self
;
}
-
(
void
)
touchesBegan
:(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:(
UIEvent
*
)
event
{
-
(
void
)
touchesBegan
:(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:(
UIEvent
*
)
event
{
UITouch
*
touch
=
[
touches
anyObject
];
CGPoint
point
=
[
touch
locationInView
:
self
];
_left
=
point
.
x
;
...
...
@@ -82,8 +60,8 @@ static CGFloat const kViewCheckSize = 62;
_viewBound
.
frame
=
frame
;
[
self
.
window
addSubview
:
_viewBound
];
// _viewI
nfoWindow.hidden = NO;
_
viewInfoLabel
.
a
ttributedText
=
[
self
viewInfo
:
view
];
// _i
nfoWindow.hidden = NO;
_
infoWindow
.
infoA
ttributedText
=
[
self
viewInfo
:
view
];
}
...
...
@@ -96,36 +74,32 @@ static CGFloat const kViewCheckSize = 62;
UIView
*
view
=
[
self
topView
:
self
.
window
Point
:
topPoint
];
CGRect
frame
=
[
self
.
window
convertRect
:
view
.
bounds
fromView
:
view
];
_viewBound
.
frame
=
frame
;
// _viewI
nfoWindow.hidden = NO;
_
viewInfoLabel
.
a
ttributedText
=
[
self
viewInfo
:
view
];
// _i
nfoWindow.hidden = NO;
_
infoWindow
.
infoA
ttributedText
=
[
self
viewInfo
:
view
];
}
-
(
void
)
touchesCancelled
:(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:(
UIEvent
*
)
event
{
[
_viewBound
removeFromSuperview
];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [UIView animateWithDuration:0.5 animations:^{
// _viewInfoWindow.alpha = 0;
// } completion:^(BOOL finished) {
// _viewInfoWindow.hidden = YES;
// _viewInfoWindow.alpha = 1;
// }];
// });
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [UIView animateWithDuration:0.5 animations:^{
// _viewInfoWindow.alpha = 0;
// } completion:^(BOOL finished) {
// _viewInfoWindow.hidden = YES;
// _viewInfoWindow.alpha = 1;
// }];
// });
}
-
(
void
)
touchesEnded
:(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:(
UIEvent
*
)
event
{
[
_viewBound
removeFromSuperview
];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [UIView animateWithDuration:0.5 animations:^{
// _viewInfoWindow.alpha = 0;
// } completion:^(BOOL finished) {
// _viewInfoWindow.hidden = YES;
// _viewInfoWindow.alpha = 1;
// }];
// });
}
-
(
void
)
closeBtnClicked
:(
id
)
sender
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
DoraemonClosePluginNotification
object
:
nil
userInfo
:
nil
];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [UIView animateWithDuration:0.5 animations:^{
// _viewInfoWindow.alpha = 0;
// } completion:^(BOOL finished) {
// _viewInfoWindow.hidden = YES;
// _viewInfoWindow.alpha = 1;
// }];
// });
}
-
(
UIView
*
)
topView
:(
UIView
*
)
view
Point
:(
CGPoint
)
point
{
...
...
@@ -155,13 +129,13 @@ static CGFloat const kViewCheckSize = 62;
}
-
(
void
)
show
{
_
viewI
nfoWindow
.
hidden
=
NO
;
_
i
nfoWindow
.
hidden
=
NO
;
self
.
hidden
=
NO
;
}
-
(
void
)
hide
{
[
_viewBound
removeFromSuperview
];
_
viewI
nfoWindow
.
hidden
=
YES
;
_
i
nfoWindow
.
hidden
=
YES
;
self
.
hidden
=
YES
;
}
...
...
@@ -186,13 +160,15 @@ static CGFloat const kViewCheckSize = 62;
NSString
*
string
=
[
NSString
stringWithFormat
:
showString
];
// 行间距
NSMutableParagraphStyle
*
style
=
[
NSMutableParagraphStyle
new
];
style
.
lineSpacing
=
kDoraemonSizeFrom750
(
12
);
style
.
lineSpacing
=
kDoraemonSizeFrom750_Landscape
(
12
);
style
.
lineBreakMode
=
NSLineBreakByTruncatingTail
;
NSMutableAttributedString
*
attrString
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
string
];
[
attrString
addAttributes
:@{
NSParagraphStyleAttributeName
:
style
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750
(
24
)],
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
kDoraemonSizeFrom750_Landscape
(
24
)],
NSForegroundColorAttributeName
:
[
UIColor
doraemon_black_1
]
}
range:
NSMakeRange
(
0
,
string
.
length
)];
...
...
@@ -228,7 +204,7 @@ static CGFloat const kViewCheckSize = 62;
if
(
alpha
<
255
)
{
//存在透明度
hex
=
[
NSString
stringWithFormat
:
@"%@ alpha:%.2f"
,
hex
,(
CGColorGetComponents
(
color
.
CGColor
))[
3
]];
}
return
hex
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录