App.shared.window = window
// window?.rootViewController = BaseTC()
-// window?.rootViewController = UINavigationController(rootViewController: HistorySelectedVC())
+// window?.rootViewController = UINavigationController(rootViewController: SportHomeVC())
AppLaunch.start()
}
case theme
/// 次级主题色
case subTheme
- /// 主标题 - 0x222222
+ /// 主标题
case first
- /// 主标题 - 0x333333
- case primary
/// 二级标题
case secondary
/// 三级标题
- case tertiary
+ case level3
case placeholder
return 0xF4FAFF
case .first:
return 0x121212
- case .primary:
- return 0x333333
case .secondary:
return 0x666666
- case .tertiary:
+ case .level3:
return 0x999999
case .placeholder:
return 0xcccccc
return 0xF4FAFF
case .first:
return 0xffffff
- case .primary:
- return 0xffffff
case .secondary:
return 0x999999
- case .tertiary:
- return 0x999999
+ case .level3:
+ return 0xcccccc
case .placeholder:
return 0x666666
case .separateLine:
+++ /dev/null
-////
-//// ShareView.swift
-//// Magpie
-////
-//// Created by incar on 2024/1/10.
-////
-//
-//import Foundation
-//extension UnAuthSchoolDetailVC{
-// class AgreementView: YLPresentView {
-// private let titleLabel = UILabel()
-// private let des = UILabel()
-// private let selectButton = UIButton()
-// private let privacyLabel = UILabel()
-// private let okButton = AnimationButton()
-// private var vm:ClassDetailVM
-//
-// init(code:String) {
-// self.vm = ClassDetailVM(code:code)
-// super.init(contentHeight: 400.fitR)
-// }
-//
-// override func setupSubView() {
-// super.setupSubView()
-// contentView.addSubview(titleLabel)
-// contentView.addSubview(des)
-// contentView.addSubview(selectButton)
-// contentView.addSubview(privacyLabel)
-// contentView.addSubview(okButton)
-// }
-// override func setupLayout() {
-// super.setupLayout()
-// titleLabel.snp.makeConstraints { (m) in
-// m.top.equalToSuperview().inset(25.fitR)
-// m.left.right.equalToSuperview()
-// m.height.greaterThanOrEqualTo(0)
-// }
-// des.snp.makeConstraints { (m) in
-// m.left.right.equalToSuperview().inset(20.fitR)
-// m.top.equalToSuperview().inset(67.fitR)
-// }
-// selectButton.snp.makeConstraints { (m) in
-// m.left.equalToSuperview().inset(20.fitR)
-// m.bottom.equalToSuperview().inset(96.fitR)
-// m.height.equalTo(15.fitR)
-// m.width.equalTo(15.fitR)
-// }
-// privacyLabel.snp.makeConstraints { (m) in
-// m.left.equalTo(selectButton.snp.right)
-// m.centerY.equalTo(selectButton)
-// }
-// okButton.snp.makeConstraints { (m) in
-// m.bottom.equalToSuperview().inset(30.fitR)
-// m.height.equalTo(44.fitR)
-// m.left.right.equalToSuperview().inset(25.fitR)
-// }
-// }
-//
-// override func setupStyle() {
-// super.setupStyle()
-// titleLabel.do { (v) in
-// v.textColor = .rgb(0x333333)
-// v.font = .semiBold(16)
-// v.textAlignment = .center
-// v.text = "诸葛驾到代运营协议说明"
-// }
-// des.do { (v) in
-// v.text = "1.用户通过诸葛驾到寻找到合适的驾校后,委托诸葛驾到负责撮合驾校学车的服务提供方,为用户代报名指定班型的学车服务,在代报名过程中提供驾校信息核验、学车权益守护、学车资金托管、代理结算等服务。具体服务内容由诸葛驾到根据实际情况提供,包括但不限于: (1) 作为用户的学车经纪人代表用户与驾校签约学车报名协议;(2)学车报名资金的托管; (3) 维护用户在驾校学车的约定权益;(4) 服务商收入结算和用户支付费用:具体金额以产生的统计数据为准;(5) 订单查询;2.用户通过诸葛驾到完成的学车报名信息以平台发布的相应信息为准,交易应签署《学车报名服务合同》。具体内容《学车报名服务合同》以约定为准,该合同文本格式由诸葛驾到平台的驾校提供,经诸葛驾到平台撮合,由用户与诸葛驾到平台的驾校直接签约。所有发给用户的通告及其他消息都可通过APP或者用户所提供的联系方式发送 。"
-// v.textAlignment = .left
-// v.numberOfLines = 0
-// v.font = .regular(12)
-// v.textColor = .color(.secondary)
-// }
-// selectButton.do { (v) in
-// v.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
-// v.setImage(nil, for: .normal)
-// v.addTarget(self, action: #selector(selectBtnAction), for: .touchUpInside)
-// }
-// privacyLabel.do { (v) in
-// v.text = " 已阅读同意协议说明"
-// v.textAlignment = .left
-// v.numberOfLines = 1
-// v.font = .regular(12)
-// v.textColor = .rgb(0x999999)
-// privacyLabel.yc.addTap(target: self, action: #selector(selectBtnAction))
-// }
-// okButton.do { (v) in
-// v.isEnabled = false
-// v.yc.addGardiendLayerWith(colors: [.color(.mainBlue),.color(.mainBlue)], frame: CGRect(x: 0, y: 0, width: kScreenWid - 50.fitR, height: 44.fitR), direction: .left2right)
-// v.setTitle("下一步", for: .normal)
-// v.setTitleColor(.color(.white), for: .normal)
-// v.titleLabel?.font = .regular(15)
-// v.yc.setCornerRadius(22.fitR)
-// v.alpha = 0.5
-// v.addTarget(self, action: #selector(okButtonAction), for: .touchUpInside)
-// self.selectBtnAction()
-//
-// }
-// }
-// @objc func okButtonAction(){
-//// self.okButtonTap?()
-//// hide()
-// self.start2LoadData()
-// }
-// @objc func selectBtnAction(){
-// selectButton.isSelected = !selectButton.isSelected
-// if selectButton.isSelected {
-// selectButton.yc.setBorder(width: 1.fitR, color: .rgb(0x036AFF), radius: 2.fitR)
-// selectButton.setImage(UIImage(named: "agreement_selected"), for: .normal)
-// privacyLabel.textColor = .rgb(0x036AFF)
-// okButton.alpha = 1
-// }
-// else{
-// selectButton.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
-// selectButton.setImage(nil, for: .normal)
-// privacyLabel.textColor = .rgb(0x999999)
-// okButton.alpha = 0.5
-// }
-// okButton.isEnabled = selectButton.isSelected
-// }
-//
-// func start2LoadData(){
-// SVProgressHUD.showLoading()
-// SVProgressHUD.setContainerView(app.window)
-// self.vm.fetchClassDetail{[weak self] (model) in
-// guard let self = self else {return}
-// if model.isSuccess{
-// SVProgressHUD.hidden()
-// self.hide()
-// let params = PayDetailVCParams(model:model.data)
-// let vc = PayDetailVC(data: params)
-// UIViewController.yc.currentNav?.pushViewController(vc, animated: true)
-// }
-// else{
-// SVProgressHUD.showAutoHiden(model.msg)
-// }
-// }
-// }
-// }
-//}
let appearance = UITabBarAppearance()
appearance.configureWithDefaultBackground()
- appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.rgb(0x999999)]
+ appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.color(.secondary)]
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
self.tabBar.standardAppearance = appearance
self.tabBar.backgroundColor = .rgb(0x242424)
v.textAlignment = .left
}
deviceLabel.do { (v) in
- v.textColor = .color(.tertiary)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .left
v.text = "共4个智能设备"
tipsLabel.do { v in
v.numberOfLines = 0
v.font = .medium(22)
- v.textColor = .rgb(0x121212)
+ v.textColor = .color(.first)
let text = "您好, \n欢迎使用DeepChords".l10n
let stype = NSMutableParagraphStyle()
stype.lineSpacing = 10
// v.backgroundColor = .green
}
line.do { v in
- v.backgroundColor = .hexString("#999999")
+ v.backgroundColor = .color(.secondary)
}
chatItem.do { v in
v.lineBreakMode = .byTruncatingTail
}
timeLabel.do { v in
- v.textColor = .rgb(0x999999)
+ v.textColor = .color(.secondary)
v.font = .regular(14)
v.textAlignment = .right
}
v.text = "移除设备后会同步退出账号,在此设备上将无法访问该账号的数据".l10n
v.textAlignment = .left
v.font = .regular(12)
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.numberOfLines = 0
}
}
}
unitLabel.do { v in
v.text = "dp"
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .left
v.font = .regular(12)
}
valueLabel1.do { v in
v.text = "+12"
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .left
v.font = .regular(12)
}
valueLabel2.do { v in
v.text = "0"
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .left
v.font = .regular(12)
}
valueLabel3.do { v in
v.text = "-12"
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .left
v.font = .regular(12)
}
}
titleLabel.do { v in
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .center
v.font = .regular(12)
v.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
}
valueLabel.do { v in
v.text = "0"
- v.textColor = .hexString("#999999")
+ v.textColor = .color(.secondary)
v.textAlignment = .center
v.font = .regular(12)
v.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
navBar.title = "白噪音".l10n
view.backgroundColor = .color(.bgColor)
segmentedView.do { (v) in
- segmentedDataSource.titleNormalColor = .hexString("#999999")
+ segmentedDataSource.titleNormalColor = .color(.secondary)
segmentedDataSource.titleSelectedColor = .color(.first)
segmentedDataSource.titleNormalFont = .regular(14)
segmentedDataSource.titleSelectedFont = .bold(16)
--- /dev/null
+//
+// MusicVC.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+
+import UIKit
+import JXSegmentedView
+
+class MusicRootView: BaseView{
+ override func setupViews() {
+ backgroundColor = UIColor.random()
+ }
+}
+
+extension MusicRootView: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return self
+ }
+}
--- /dev/null
+//
+// RecordView.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+
+import UIKit
+import JXSegmentedView
+
+class RecordRootView: BaseView{
+ override func setupViews() {
+ backgroundColor = UIColor.random()
+ }
+}
+
+extension RecordRootView: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return self
+ }
+}
+
--- /dev/null
+//
+// SportVC.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+
+import UIKit
+import JXSegmentedView
+
+class SportRootView: BaseView{
+ override func setupViews() {
+ backgroundColor = UIColor.random()
+ }
+}
+
+extension SportRootView: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return self
+ }
+}
--- /dev/null
+//
+// SportTypeView.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+import UIKit
+
+class SportTypeView: BaseView{
+ override func setupViews() {
+
+ }
+
+
+ class SportTypeView: BaseView{
+ override func setupViews() {
+
+ }
+
+
+
+ }
+}
--- /dev/null
+//
+// SportHomeVC.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+
+import JXSegmentedView
+
+
+enum SportHomeType{
+ case sport
+ case record
+ case translate
+ case music
+
+ var name:String{
+ switch self {
+ case .sport:
+ return "运动"
+ case .record:
+ return "录音"
+ case .translate:
+ return "翻译"
+ case .music:
+ return "音乐"
+ }
+ }
+ static var all:[SportHomeType] = [.sport,.record,.translate,.music]
+}
+
+class SportHomeVC: BaseVC {
+ private let segmentedDataSource = JXSegmentedTitleDataSource()
+ private let segmentedView = JXSegmentedView()
+ private lazy var listContainerView: JXSegmentedListContainerView! = {
+ let view = JXSegmentedListContainerView(dataSource: self, type: .scrollView)
+ return view
+ }()
+
+ var list:[SportHomeType] = SportHomeType.all
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ // AudioPlayView.shared.show()
+ self.view.addSubview(AudioPlayView.shared)
+ }
+
+ override func setupLayout(){
+
+ segmentedView.snp.makeConstraints { (m) in
+ m.left.right.equalToSuperview()
+ m.height.equalTo(44.fitR)
+ m.top.equalToSuperview().inset(kNavBtm)
+ }
+ listContainerView.snp.makeConstraints { (m) in
+ m.width.left.equalToSuperview()
+ m.top.equalTo(segmentedView.snp.bottom)
+ m.bottom.equalToSuperview()
+ }
+ }
+ override func setupViews(){
+ view.addSubview(segmentedView)
+ view.addSubview(listContainerView)
+
+ view.backgroundColor = .color(.bgColor)
+ segmentedView.do { (v) in
+ segmentedDataSource.titleNormalColor = .color(.secondary)
+ segmentedDataSource.titleSelectedColor = .color(.first)
+ segmentedDataSource.titleNormalFont = .regular(14)
+ segmentedDataSource.titleSelectedFont = .bold(16)
+ segmentedDataSource.isTitleZoomEnabled = true
+ // segmentedDataSource.titleSelectedZoomScale = 1
+ segmentedDataSource.isTitleStrokeWidthEnabled = true
+ segmentedDataSource.isItemSpacingAverageEnabled = true
+ segmentedDataSource.isTitleColorGradientEnabled = true
+ segmentedDataSource.titles = list.map{"\($0.name)"}
+ segmentedView.backgroundColor = .clear
+
+ //配置指示器
+ let indicator = JXSegmentedIndicatorLineView()
+ indicator.indicatorWidth = 20
+ indicator.indicatorHeight = 4
+ indicator.verticalOffset = 6
+ indicator.indicatorColor = .color(.theme)
+ segmentedView.indicators = [indicator]
+
+ v.dataSource = segmentedDataSource
+ v.listContainer = listContainerView
+ }
+ }
+}
+
+extension SportHomeVC: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return view
+ }
+}
+
+extension SportHomeVC: JXSegmentedListContainerViewDataSource {
+ func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
+ if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
+ return titleDataSource.dataSource.count
+ }
+ return 0
+ }
+
+ func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+ let type = list[index]
+ switch type {
+ case .sport:
+ return SportRootView()
+ case .record:
+ return RecordRootView()
+ case .translate:
+ return TranslateRootView()
+ case .music:
+ return MusicRootView()
+ }
+
+ }
+}
--- /dev/null
+//
+// TranslateVC.swift
+// ShenYin
+//
+// Created by liangshi on 2026/1/20.
+//
+
+import UIKit
+import JXSegmentedView
+
+class TranslateRootView: BaseView{
+ override func setupViews() {
+ backgroundColor = UIColor.random()
+ }
+}
+
+extension TranslateRootView: JXSegmentedListContainerViewListDelegate {
+ func listView() -> UIView {
+ return self
+ }
+}
+++ /dev/null
-//
-// AgreeMentPopView.swift
-// Magpie
-//
-// Created by incar on 2024/1/11.
-//
-
-import UIKit
-
-class AgreeMentPopView: BasePresentView {
- private let titleLabel = UILabel()
- private let des = UILabel()
- private let selectButton = UIButton()
- private let privacyLabel = UILabel()
- private let okButton = UIButton()
-
- init() {
- super.init(contentHeight: 400.fitR)
- }
-
- required init?(coder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
-
- override func setupSubView() {
- super.setupSubView()
- contentView.addSubview(titleLabel)
- contentView.addSubview(des)
- contentView.addSubview(selectButton)
- contentView.addSubview(privacyLabel)
- contentView.addSubview(okButton)
- }
- override func setupLayout() {
- super.setupLayout()
- titleLabel.snp.makeConstraints { (m) in
- m.top.equalToSuperview().inset(25.fitR)
- m.left.right.equalToSuperview()
- m.height.greaterThanOrEqualTo(0)
- }
- des.snp.makeConstraints { (m) in
- m.left.right.equalToSuperview().inset(20.fitR)
- m.top.equalToSuperview().inset(67.fitR)
- }
- selectButton.snp.makeConstraints { (m) in
- m.left.equalToSuperview().inset(20.fitR)
- m.bottom.equalToSuperview().inset(96.fitR)
- m.height.equalTo(15.fitR)
- m.width.equalTo(15.fitR)
- }
- privacyLabel.snp.makeConstraints { (m) in
- m.left.equalTo(selectButton.snp.right)
- m.centerY.equalTo(selectButton)
- }
- okButton.snp.makeConstraints { (m) in
- m.bottom.equalToSuperview().inset(30.fitR)
- m.height.equalTo(44.fitR)
- m.left.right.equalToSuperview().inset(25.fitR)
- }
- }
-
- override func setupStyle() {
- super.setupStyle()
- titleLabel.do { (v) in
- v.textColor = .rgb(0x333333)
- v.font = .semiBold(16)
- v.textAlignment = .center
- v.text = "诸葛驾到代运营协议说明"
- }
- des.do { (v) in
- v.text = "1.用户通过诸葛驾到寻找到合适的驾校后,委托诸葛驾到负责撮合驾校学车的服务提供方,为用户代报名指定班型的学车服务,在代报名过程中提供驾校信息核验、学车权益守护、学车资金托管、代理结算等服务。具体服务内容由诸葛驾到根据实际情况提供,包括但不限于: (1) 作为用户的学车经纪人代表用户与驾校签约学车报名协议;(2)学车报名资金的托管; (3) 维护用户在驾校学车的约定权益;(4) 服务商收入结算和用户支付费用:具体金额以产生的统计数据为准;(5) 订单查询;2.用户通过诸葛驾到完成的学车报名信息以平台发布的相应信息为准,交易应签署《学车报名服务合同》。具体内容《学车报名服务合同》以约定为准,该合同文本格式由诸葛驾到平台的驾校提供,经诸葛驾到平台撮合,由用户与诸葛驾到平台的驾校直接签约。所有发给用户的通告及其他消息都可通过APP或者用户所提供的联系方式发送 。"
- v.textAlignment = .left
- v.numberOfLines = 0
- v.font = .regular(12)
- v.textColor = .color(.secondary)
- }
- selectButton.do { (v) in
- v.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
- v.setImage(nil, for: .normal)
- v.addTarget(self, action: #selector(selectBtnAction), for: .touchUpInside)
- }
- privacyLabel.do { (v) in
- v.text = " 已阅读同意协议说明"
- v.textAlignment = .left
- v.numberOfLines = 1
- v.font = .regular(12)
- v.textColor = .rgb(0x999999)
- privacyLabel.yc.addTap(target: self, action: #selector(selectBtnAction))
- }
- okButton.do { (v) in
- v.isEnabled = false
- v.yc.addGardiendLayerWith(colors: [.red,.blue], frame: CGRect(x: 0, y: 0, width: kScreenWid - 50.fitR, height: 44.fitR), direction: .left2right)
- v.setTitle("下一步", for: .normal)
- v.setTitleColor(.white, for: .normal)
- v.titleLabel?.font = .regular(15)
- v.yc.setCornerRadius(22.fitR)
- v.alpha = 0.5
- v.addTarget(self, action: #selector(okButtonAction), for: .touchUpInside)
- self.selectBtnAction()
-
- }
- }
- @objc func okButtonAction(){
- // self.okButtonTap?()
- // hide()
- self.start2LoadData()
- }
- @objc func selectBtnAction(){
- selectButton.isSelected = !selectButton.isSelected
- if selectButton.isSelected {
- selectButton.yc.setBorder(width: 1.fitR, color: .rgb(0x036AFF), radius: 2.fitR)
- selectButton.setImage(UIImage(named: "agreement_selected"), for: .normal)
- privacyLabel.textColor = .rgb(0x036AFF)
- okButton.alpha = 1
- }
- else{
- selectButton.yc.setBorder(width: 1.fitR, color: .rgb(0x999999), radius: 2.fitR)
- selectButton.setImage(nil, for: .normal)
- privacyLabel.textColor = .rgb(0x999999)
- okButton.alpha = 0.5
- }
- okButton.isEnabled = selectButton.isSelected
- }
-
- func start2LoadData(){
- // SVProgressHUD.showLoading()
- // SVProgressHUD.setContainerView(app.window)
- // self.vm.fetchClassDetail{[weak self] (model) in
- // guard let self = self else {return}
- // if model.isSuccess{
- // SVProgressHUD.hidden()
- // self.hide()
- // let params = PayDetailVCParams(model:model.data)
- // let vc = PayDetailVC(data: params)
- // UIViewController.yc.currentNav?.pushViewController(vc, animated: true)
- // }
- // else{
- // SVProgressHUD.showAutoHiden(model.msg)
- // }
- // }
- }
-}
-
titleLabel.textColor = .color(.first)
}
else{
- titleLabel.textColor = .rgb(0x999999)
+ titleLabel.textColor = .color(.secondary)
}
}
}
titleLabel.textColor = .color(.first)
}
else{
- titleLabel.textColor = .rgb(0x999999)
+ titleLabel.textColor = .color(.level3)
}
}
}
v.setImage(UIImage(named: "tip_selected"), for: .selected)
}
agreeTitle.do { (v) in
- v.textColor = .color(.tertiary)
+ v.textColor = .color(.secondary)
v.font = .regular(12)
v.textAlignment = .left
v.text = "下次不再提示".l10n