Commit 92f0fb20 authored by zhangzhe's avatar zhangzhe

新建笔记页

parent 483eb3fe
......@@ -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
}
......
......@@ -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());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment