//
|
// PlaySettingView.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/8/14.
|
//
|
|
import UIKit
|
import QMUIKit
|
import JQTools
|
|
class PlaySettingView: UIView,JQNibView{
|
@IBOutlet weak var slider_voice: UISlider!
|
@IBOutlet weak var cons_bottom: NSLayoutConstraint!
|
|
override func awakeFromNib() {
|
super.awakeFromNib()
|
|
alpha = 0
|
cons_bottom.constant = -JQ_ScreenW
|
|
let v1 = UIView()
|
v1.backgroundColor = UIColor(hexStr: "#B6DC90")
|
v1.bounds = CGRect(x: 0, y: 0, width: 17, height: 17)
|
v1.jq_borderWidth = 2
|
v1.jq_borderColor = .white
|
v1.jq_cornerRadius = 8.5
|
|
slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .normal)
|
slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .highlighted)
|
|
layoutIfNeeded()
|
}
|
|
static func show(){
|
let settingView = PlaySettingView.jq_loadNibView()
|
settingView.frame = sceneDelegate?.window?.frame ?? .zero
|
sceneDelegate?.window?.addSubview(settingView)
|
|
settingView.cons_bottom.constant = 65.5
|
|
UIView.animate(withDuration: 0.4) {
|
settingView.alpha = 1
|
settingView.layoutIfNeeded()
|
}
|
}
|
|
@IBAction func hiddenAction(_ sender: UIButton) {
|
self.cons_bottom.constant = -JQ_ScreenW
|
UIView.animate(withDuration: 0.4) {
|
self.alpha = 0
|
self.layoutIfNeeded()
|
} completion: { _ in
|
self.removeFromSuperview()
|
}
|
}
|
}
|