Blame view

Twear/Setting(设置)/VIew/DailCell.swift 1.45 KB
75d24c15   yangbin   123
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  //
  //  DailCell.swift
  //  Twear
  //
  //  Created by yangbin on 2021/12/21.
  //
  
  import UIKit
  
  class DailCell: UICollectionViewCell {
      
      @IBOutlet weak var progressView: CustomProgress!
      @IBOutlet weak var dailImageView: UIImageView!
      
      var cellClickClosure: (() -> ())?
      
      func updateProgressView(_ value: Int) {
          progressView.value = value
          progressView.layer.borderWidth = 1
          progressView.layer.borderColor = UIColor.rgbColorFromHex(0x00993E).cgColor
          progressView.label.text = LocString("同步中...")
          progressView.label.textColor = .black
      }
      
      func syncComplete() {
          progressView.trackView.backgroundColor = LineColor
          progressView.layer.borderColor = LineColor.cgColor
          progressView.layer.borderWidth = 0
          progressView.label.text = LocString("已同步")
          progressView.label.textColor = .black
      }
  
      
  
  
      
      override func awakeFromNib() {
          super.awakeFromNib()
          progressView.label.text = LocString("同步")
          progressView.label.textColor = UIColor.rgbColorFromHex(0x00993E)
          progressView.layer.borderWidth = 1
          progressView.layer.borderColor = UIColor.rgbColorFromHex(0x00993E).cgColor
          progressView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickHeaderView(_:))))
      }
      
      @objc private func clickHeaderView(_ gestureRecognizer: UITapGestureRecognizer) {
          cellClickClosure?()
      }
  }