Browse Source

feat:删除文件

kailen 1 month ago
parent
commit
da271bac48

+ 0 - 49
TSLiveWallpaper/Business/TSMusic/Detail/View/PlayButtonView.swift

@@ -1,49 +0,0 @@
-//
-//  PlayButtonView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-import Foundation
-import UIKit
-
-enum PlayState {
-    case pause
-    case playing
-}
-
-class PlayButtonView: UIControl {
-    var playingState: PlayState = .pause {
-        didSet {
-            if playingState == .pause {
-                iconView.image = UIImage(named: "ic_detail_playBtn")
-            } else {
-                iconView.image = UIImage(named: "ic_detail_pauseBtn")
-            }
-        }
-    }
-
-    lazy var iconView: UIImageView = .init(image: UIImage(named: "ic_detail_playBtn"))
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-    }
-
-    func makeConstraints() {
-        iconView.contentMode = .scaleAspectFit
-        iconView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 59
TSLiveWallpaper/Business/TSMusic/Helper/CWOperateButton.swift

@@ -1,59 +0,0 @@
-//
-//  CWOperateButton.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/23.
-//
-
-import Foundation
-import UIKit
-
-class CWOperateButton : UIControl {
-    
-    lazy var bgView : UIView = .simpleView(color: .white.withAlphaComponent(0.1))
-    
-    lazy var iconView : UIImageView = .simpleImage(imageName: "icon_delete")
-    
-    lazy var titleLabel : UILabel = .simpleLabel(text: "Delete".localized(),font: .systemFont12,color: .white)
-    
-    
-    init(title:String,imgName:String) {
-        super.init(frame: .zero)
-        self.iconView.image = UIImage.init(named: imgName)
-        self.titleLabel.text = title
-        self.titleLabel.textAlignment = .center
-        bgView.isUserInteractionEnabled = false
-        addChildren()
-        makeConstraints()
-    }
-    
-    func addChildren(){
-        bgView.customCornerRadius = 16
-        addSubview(bgView)
-        bgView.addSubview(iconView)
-        addSubview(titleLabel)
-    }
-    
-    func makeConstraints(){
-        bgView.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.centerX.equalToSuperview()
-            make.height.width.equalTo(48)
-        }
-        
-        iconView.snp.makeConstraints { make in
-            make.center.equalTo(bgView)
-        }
-        
-        titleLabel.snp.makeConstraints { make in
-            make.leading.trailing.equalToSuperview()
-            make.width.greaterThanOrEqualTo(48)
-            make.bottom.equalToSuperview()
-            make.top.equalTo(bgView.snp.bottom).offset(8)
-        }
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 181
TSLiveWallpaper/Business/TSMusic/Helper/DownloadButton.swift

@@ -1,181 +0,0 @@
-//
-//  DownloadButton.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import Kingfisher
-
-enum DownloadButtonState {
-    case idle(isAnimate: Bool)
-    case loading
-    case downloading
-    case pause
-    case retry
-    case done
-
-    var imageName: String {
-        switch self {
-        case let .idle(isAnimate):
-            if isAnimate {
-                return "download"
-            } else {
-                return "ic_download"
-            }
-        case .loading:
-            return ""
-        case .downloading:
-            return ""
-        case .pause:
-            return "ic_download_pause"
-        case .retry:
-            return "ic_retry"
-        case .done:
-            return "icon_more"
-        }
-    }
-}
-
-class DownloadButton: UIControl {
-    
-    lazy var adTag: UIImageView = {
-        let tag = UIImageView(image: UIImage(named: "ic_tag"))
-        tag.isHidden = false
-        return tag
-    }()
-    
-    /// 下载状态
-    var downloadState: DownloadButtonState = .idle(isAnimate: false) {
-        didSet {
-            setStateForButton()
-        }
-    }
-
-    lazy var loadingView: UIImageView = {
-        let img = UIImageView(image: UIImage(named: "ic-rotate-loading"))
-        img.isHidden = true
-        return img
-    }()
-
-    /// 进度条
-    lazy var progressView: CWCustomProgressView = {
-        let progress = CWCustomProgressView()
-        progress.isHidden = true
-        progress.isUserInteractionEnabled = false
-        return progress
-    }()
-
-    lazy var stateImageView: AnimatedImageView = AnimatedImageView()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(progressView)
-        addSubview(stateImageView)
-        addSubview(loadingView)
-        addSubview(adTag)
-    }
-
-    func makeConstraints() {
-        
-        adTag.snp.makeConstraints { make in
-            make.centerX.equalToSuperview().offset(13)
-            make.centerY.equalToSuperview().offset(-10)
-            make.width.equalTo(14.4)
-            make.height.equalTo(12)
-        }
-        
-        progressView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-            make.width.height.equalTo(40)
-        }
-
-        stateImageView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-            make.width.height.equalTo(24)
-        }
-
-        loadingView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-        }
-    }
-
-    private func startLoadingAnimation() {
-        // 1.创建动画
-        let animation = CABasicAnimation(keyPath: "transform.rotation.z")
-        // 2.设置动画属性
-        animation.fromValue = 0 // 开始角度
-        animation.toValue = Double.pi * 2 // 结束角度
-        animation.repeatCount = .greatestFiniteMagnitude // 重复次数
-        animation.duration = 1
-        // 动画完成后自动重新开始,默认为NO
-        animation.autoreverses = false
-        // 默认是true,切换到其他控制器再回来,动画效果会消失,需要设置成false,动画就不会停了
-        animation.isRemovedOnCompletion = false
-        loadingView.layer.add(animation, forKey: nil) // 给需要旋转的view增加动画
-    }
-
-    func setStateForButton() {
-        stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-        stateImageView.snp.updateConstraints { make in
-            make.width.height.equalTo(24)
-        }
-        switch downloadState {
-        case let .idle(animate):
-            if !animate {
-                stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-                stateImageView.snp.updateConstraints { make in
-                    make.width.height.equalTo(24)
-                }
-            }else{
-//                let path = Bundle.main.path(forResource:downloadState.imageName, ofType:"gif")
-//                let url = URL(fileURLWithPath: path!)
-//                let resource = Kingfisher.KF.ImageResource(downloadURL: url)
-//                stateImageView.kf.setImage(with: resource)
-//                stateImageView.snp.updateConstraints { make in
-//                    make.width.height.equalTo(24)
-//                }
-                stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-                stateImageView.snp.updateConstraints { make in
-                    make.width.height.equalTo(24)
-                }
-            }
-            progressView.isHidden = true
-            loadingView.isHidden = true
-            adTag.isHidden = PurchaseManager.default.isVip
-        case .loading:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = false
-            startLoadingAnimation()
-        case .downloading:
-            adTag.isHidden = true
-            progressView.isHidden = false
-            progressView.progressTitle.isHidden = false
-            loadingView.isHidden = true
-        case .pause:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            progressView.progressTitle.isHidden = true
-            loadingView.isHidden = true
-        case .retry:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = true
-        case .done:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = true
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 56
TSLiveWallpaper/Business/TSMusic/List/View/CWTopCustomButton.swift

@@ -1,56 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import UIKit
-
-class CWTopCustomButton: UIControl {
-    lazy var iconView: UIImageView = .init(image: UIImage(named: "icon_mine_favourite"))
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Like".localized(), font: .systemFont16, color: .white.withAlphaComponent(0.8))
-    lazy var countLabel: UILabel = .simpleLabel(text: "0", font: .systemFont14, color: .white.withAlphaComponent(0.4))
-
-    init(iconName: String, title: String) {
-        super.init(frame: .zero)
-        backgroundColor = .white.withAlphaComponent(0.1)
-        layer.cornerRadius = 16
-        iconView.image = UIImage(named: iconName)
-        iconView.clipsToBounds = true
-        titleLabel.text = title
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-        addSubview(titleLabel)
-        addSubview(countLabel)
-    }
-
-    func makeConstraints() {
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(12)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(60)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.top.equalTo(iconView.snp.top).offset(5)
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-12)
-        }
-
-        countLabel.snp.makeConstraints { make in
-            make.bottom.equalTo(iconView.snp.bottom).offset(-5)
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-12)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 48
TSLiveWallpaper/Business/TSMusic/MusicBase/GradientButton.swift

@@ -1,48 +0,0 @@
-//
-//  GradientButton.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/8.
-//
-
-import Foundation
-import UIKit
-
-public class GradientButton: UIButton {
-    var colors: [UIColor]?
-    var from: CGPoint = CGPoint(x: 0, y: 0)
-    var to: CGPoint = CGPoint(x: 1, y: 0)
-    var index: Int?
-    
-    public required init(colors: [UIColor]? = nil,
-                  from: CGPoint = CGPoint(x: 0, y: 0),
-                  to: CGPoint = CGPoint(x: 1, y: 0),
-                  index: Int? = nil) {
-        self.colors = colors
-        self.from = from
-        self.to = to
-        self.index = index
-        super.init(frame: .zero)
-    }
-    
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-    }
-    
-    public override func layoutSubviews() {
-        super.layoutSubviews()
-        if let colors = colors {
-            setGradient(colors: colors, from: from, to: to, index: index)
-        }
-    }
-    
-    public func set(colors: [UIColor]? = nil,
-                    from: CGPoint = CGPoint(x: 0, y: 0),
-                    to: CGPoint = CGPoint(x: 1, y: 0),
-                    index: Int? = nil) {
-        self.colors = colors
-        self.from = from
-        self.to = to
-        self.index = index
-    }
-}