B面对播放加载状态的新优化,使用原生控件
This commit is contained in:
parent
c69dc5411c
commit
0325c4b832
@ -111,6 +111,7 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
|||||||
//活动加载器
|
//活动加载器
|
||||||
private lazy var activityIndicator:UIActivityIndicatorView = {
|
private lazy var activityIndicator:UIActivityIndicatorView = {
|
||||||
let activityIndicator:UIActivityIndicatorView = .init(frame: .init(x: 0, y: 0, width: 66*width, height: 66*width))
|
let activityIndicator:UIActivityIndicatorView = .init(frame: .init(x: 0, y: 0, width: 66*width, height: 66*width))
|
||||||
|
activityIndicator.style = .gray
|
||||||
activityIndicator.backgroundColor = .white
|
activityIndicator.backgroundColor = .white
|
||||||
activityIndicator.layer.masksToBounds = true
|
activityIndicator.layer.masksToBounds = true
|
||||||
activityIndicator.layer.cornerRadius = 33*width
|
activityIndicator.layer.cornerRadius = 33*width
|
||||||
@ -294,6 +295,7 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
|||||||
make.center.equalTo(playBtn)
|
make.center.equalTo(playBtn)
|
||||||
make.width.height.equalTo(playBtn)
|
make.width.height.equalTo(playBtn)
|
||||||
}
|
}
|
||||||
|
activityIndicator.isHidden = false
|
||||||
activityIndicator.startAnimating()
|
activityIndicator.startAnimating()
|
||||||
bottomView.addSubview(listBtn)
|
bottomView.addSubview(listBtn)
|
||||||
listBtn.snp.makeConstraints { make in
|
listBtn.snp.makeConstraints { make in
|
||||||
@ -372,8 +374,16 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
|||||||
switch state {
|
switch state {
|
||||||
case .Playing:
|
case .Playing:
|
||||||
self?.playBtn.isSelected = true
|
self?.playBtn.isSelected = true
|
||||||
|
self?.activityIndicator.isHidden = true
|
||||||
|
self?.activityIndicator.stopAnimating()
|
||||||
|
case .Pause:
|
||||||
|
self?.playBtn.isSelected = false
|
||||||
|
self?.activityIndicator.isHidden = true
|
||||||
|
self?.activityIndicator.stopAnimating()
|
||||||
default:
|
default:
|
||||||
self?.playBtn.isSelected = false
|
self?.playBtn.isSelected = false
|
||||||
|
self?.activityIndicator.isHidden = false
|
||||||
|
self?.activityIndicator.startAnimating()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user