parent
6a0b827eac
commit
d8493e0767
@ -0,0 +1,137 @@
|
||||
//
|
||||
// PlayerBarView.swift
|
||||
// IndieMusic
|
||||
//
|
||||
// Created by WenLei on 2023/11/7.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class PlayerTabBar: UIView {
|
||||
private var coverView: UIImageView = {
|
||||
var coverView = UIImageView.init()
|
||||
coverView.backgroundColor = .red
|
||||
return coverView
|
||||
}()
|
||||
|
||||
private var containerView: UIView = {
|
||||
var containerView = UIView.init()
|
||||
containerView.backgroundColor = .white
|
||||
|
||||
return containerView
|
||||
}()
|
||||
|
||||
private var titleLabel: UILabel = {
|
||||
var titleLabel = UILabel.init()
|
||||
return titleLabel
|
||||
}()
|
||||
|
||||
private var artistLabel: UILabel = {
|
||||
var artistLabel = UILabel.init()
|
||||
return artistLabel
|
||||
}()
|
||||
|
||||
private var playButton: UIButton = {
|
||||
var playButton = UIButton.init()
|
||||
playButton.setImage(UIImage.init(named: "playerBar_play_btn"), for: .normal)
|
||||
|
||||
return playButton
|
||||
}()
|
||||
|
||||
private var listButton: UIButton = {
|
||||
var listButton = UIButton.init()
|
||||
listButton.setImage(UIImage.init(named: "playerBar_list_btn"), for: .normal)
|
||||
return listButton
|
||||
}()
|
||||
|
||||
private var progressView: UIProgressView = {
|
||||
var progressView = UIProgressView.init()
|
||||
return progressView
|
||||
}()
|
||||
|
||||
|
||||
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
makeUI()
|
||||
|
||||
titleLabel.text = "测试标题"
|
||||
artistLabel.text = "测试"
|
||||
progressView.progress = 0.25
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
||||
func makeUI() {
|
||||
|
||||
|
||||
|
||||
containerView.addSubview(titleLabel)
|
||||
containerView.addSubview(artistLabel)
|
||||
containerView.addSubview(playButton)
|
||||
containerView.addSubview(listButton)
|
||||
addSubview(containerView)
|
||||
addSubview(progressView)
|
||||
addSubview(coverView)
|
||||
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
coverView.snp.remakeConstraints { make in
|
||||
make.left.equalTo(self).offset(30)
|
||||
make.top.equalTo(self).offset(0)
|
||||
make.size.equalTo(CGSize.init(width: 52, height: 52))
|
||||
make.bottom.equalTo(self).offset(-14)
|
||||
}
|
||||
|
||||
containerView.snp.makeConstraints { make in
|
||||
make.left.equalTo(self)
|
||||
make.right.equalTo(self)
|
||||
make.bottom.equalTo(self)
|
||||
make.height.equalTo(54)
|
||||
}
|
||||
|
||||
listButton.snp.makeConstraints { make in
|
||||
make.right.equalTo(containerView).offset(-30)
|
||||
make.centerY.equalTo(containerView)
|
||||
make.size.equalTo(CGSize.init(width: 24, height: 24))
|
||||
}
|
||||
|
||||
playButton.snp.makeConstraints { make in
|
||||
make.right.equalTo(listButton.snp.left).offset(-18)
|
||||
make.centerY.equalTo(containerView)
|
||||
make.size.equalTo(CGSize.init(width: 24, height: 24))
|
||||
}
|
||||
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.top.equalTo(containerView).offset(5)
|
||||
make.left.equalTo(coverView.snp.right).offset(11)
|
||||
make.right.equalTo(playButton.snp.left).offset(-10)
|
||||
}
|
||||
|
||||
artistLabel.snp.makeConstraints { make in
|
||||
make.top.equalTo(titleLabel.snp.bottom)
|
||||
make.left.equalTo(coverView.snp.right).offset(11)
|
||||
make.right.equalTo(playButton.snp.left).offset(-10)
|
||||
}
|
||||
|
||||
progressView.snp.makeConstraints { make in
|
||||
make.left.equalTo(self).offset(30)
|
||||
make.right.equalTo(self).offset(-30)
|
||||
make.bottom.equalTo(self)
|
||||
make.height.equalTo(2)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//
|
||||
// PlayerViewController.swift
|
||||
// IndieMusic
|
||||
//
|
||||
// Created by WenLei on 2023/11/7.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class PlayerViewController: ViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// hidesBottomBarWhenPushed = false
|
||||
|
||||
|
||||
self.navigationTitle = "1234"
|
||||
self.navigationController?.setNavigationBarHidden(false, animated: true)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
if let tabbar = self.tabBarController as? HomeTabBarController {
|
||||
|
||||
|
||||
}
|
||||
//
|
||||
// let vc = MineViewController.init(viewModel: viewModel, navigator: navigator)
|
||||
//
|
||||
// self.present(vc, animated: true)
|
||||
|
||||
|
||||
// UIView.animate(withDuration: 0.3) {
|
||||
// self.tabBarController?.tabBar.isHidden.toggle()
|
||||
// }
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "playerBar_list_btn.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1007 B |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "playerBar_play_btn.svg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 440 B |
Loading…
Reference in new issue