Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
ShorthandMaster
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
ShorthandMaster
Commits
92f0fb20
Commit
92f0fb20
authored
Sep 29, 2020
by
zhangzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建笔记页
parent
483eb3fe
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
336 additions
and
65 deletions
+336
-65
SHInputController.swift
ShorthandMaster/Input/Controller/SHInputController.swift
+262
-61
SHInputBottomView.swift
ShorthandMaster/Input/View/SHInputBottomView.swift
+72
-3
SHInputView.swift
ShorthandMaster/Input/View/SHInputView.swift
+2
-1
No files found.
ShorthandMaster/Input/Controller/SHInputController.swift
View file @
92f0fb20
This diff is collapsed.
Click to expand it.
ShorthandMaster/Input/View/SHInputBottomView.swift
View file @
92f0fb20
...
...
@@ -52,6 +52,15 @@ class SHInputBottomView: UIView {
var
directionImageView
:
UIImageView
!
/// 复制按钮
var
copyButton
:
UIButton
!
/// 分享按钮
var
shareButton
:
UIButton
!
/// 是否为编辑状态
var
isEdited
:
Bool
=
Bool
()
/// 计时器控制小红点闪烁
let
timer
=
DispatchSource
.
makeTimerSource
(
flags
:
[],
queue
:
DispatchQueue
.
global
())
...
...
@@ -61,6 +70,8 @@ class SHInputBottomView: UIView {
{
super
.
init
(
frame
:
frame
)
self
.
isEdited
=
isEdited
self
.
backgroundColor
=
UIColor
.
white
self
.
layer
.
masksToBounds
=
true
...
...
@@ -165,22 +176,36 @@ class SHInputBottomView: UIView {
// 录制结束播放控件
self
.
playView
=
SHInputAudioPlayView
()
self
.
addSubview
(
self
.
playView
)
self
.
playView
.
isHidden
=
true
self
.
playView
.
isHidden
=
!
self
.
isEdited
// 播放进度条
self
.
progressView
=
SHInputProgressView
()
self
.
addSubview
(
self
.
progressView
)
self
.
progressView
.
alpha
=
0
;
self
.
progressView
.
alpha
=
self
.
isEdited
?
1
:
0
;
// 键盘按钮
self
.
keyboardButton
=
UIButton
(
type
:
UIButton
.
ButtonType
.
custom
)
self
.
keyboardButton
.
setImage
(
UIImage
(
named
:
"input_keyboard"
),
for
:
UIControl
.
State
.
normal
)
self
.
addSubview
(
self
.
keyboardButton
)
self
.
keyboardButton
.
isHidden
=
self
.
isEdited
// 箭头图片
self
.
directionImageView
=
UIImageView
()
self
.
directionImageView
.
image
=
UIImage
(
named
:
"input_down"
)
self
.
addSubview
(
self
.
directionImageView
)
self
.
directionImageView
.
isHidden
=
self
.
isEdited
// 复制按钮
self
.
copyButton
=
UIButton
(
type
:
.
custom
)
self
.
copyButton
.
setImage
(
UIImage
(
named
:
"input_copy"
),
for
:
.
normal
)
self
.
addSubview
(
self
.
copyButton
)
self
.
copyButton
.
isHidden
=
!
self
.
isEdited
// 分享按钮
self
.
shareButton
=
UIButton
(
type
:
.
custom
)
self
.
shareButton
.
setImage
(
UIImage
(
named
:
"input_share"
),
for
:
.
normal
)
self
.
addSubview
(
self
.
shareButton
)
self
.
shareButton
.
isHidden
=
!
self
.
isEdited
}
// MARK: - 控件位置
...
...
@@ -188,6 +213,51 @@ class SHInputBottomView: UIView {
func
setUpEditedSUbviewsLocation
()
{
self
.
line
.
mas_makeConstraints
{
(
make
)
in
make
?
.
top
.
left
()?
.
right
()?
.
mas_equalTo
()(
0
)
make
?
.
height
.
mas_equalTo
()(
1
)
}
self
.
progressView
.
mas_makeConstraints
{
(
make
)
in
make
?
.
top
.
left
()?
.
right
()?
.
mas_equalTo
()(
self
)
make
?
.
height
.
mas_equalTo
()(
50
)
}
self
.
playView
.
mas_makeConstraints
{
(
make
)
in
make
?
.
bottom
.
mas_equalTo
()(
-
SafeAreaBottomHeight
()
-
10
)
make
?
.
left
.
mas_equalTo
()(
20
)
make
?
.
size
.
mas_equalTo
()(
CGSize
(
width
:
160
,
height
:
30
))
}
self
.
shareButton
.
mas_makeConstraints
{
(
make
)
in
make
?
.
right
.
mas_equalTo
()(
-
10
)
make
?
.
bottom
.
mas_equalTo
()(
-
SafeAreaBottomHeight
())
make
?
.
width
.
height
()?
.
mas_equalTo
()(
28
+
10
*
2
)
}
self
.
copyButton
.
mas_makeConstraints
{
(
make
)
in
make
?
.
right
.
equalTo
()(
self
.
shareButton
.
mas_left
)?
.
offset
()(
5
)
make
?
.
bottom
.
equalTo
()(
self
.
shareButton
)
make
?
.
size
.
equalTo
()(
self
.
shareButton
)
}
self
.
imageButton
.
mas_makeConstraints
{
(
make
)
in
make
?
.
right
.
equalTo
()(
self
.
copyButton
.
mas_left
)?
.
offset
()(
5
)
make
?
.
bottom
.
equalTo
()(
self
.
shareButton
)
make
?
.
size
.
equalTo
()(
self
.
shareButton
)
}
}
// MARK: 新增时的控件位置
...
...
@@ -336,7 +406,6 @@ class SHInputBottomView: UIView {
timer
.
setEventHandler
{
DispatchQueue
.
main
.
sync
{
print
(
"在集市"
)
self
.
audioTimePointView
.
isHidden
=
!
self
.
audioTimePointView
.
isHidden
}
...
...
ShorthandMaster/Input/View/SHInputView.swift
View file @
92f0fb20
...
...
@@ -16,6 +16,7 @@ class SHInputView: UIView {
var
bottomView
:
SHInputBottomView
!
/// 是否为编辑状态
var
isEdited
:
Bool
=
Bool
()
...
...
@@ -89,7 +90,7 @@ class SHInputView: UIView {
self
.
bottomView
.
mas_makeConstraints
{
(
make
)
in
make
?
.
left
.
right
()?
.
bottom
()
.
mas_equalTo
()(
0
)
make
?
.
height
.
mas_equalTo
()(
50
+
SafeAreaBottomHeight
());
make
?
.
height
.
mas_equalTo
()(
(
self
.
isEdited
?
100
:
50
)
+
SafeAreaBottomHeight
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment