75d24c15
yangbin
123
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//
// 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!
|
582f536d
yangbin
common:2022.1.28
|
14
|
var isSync = false
|
75d24c15
yangbin
123
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
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
}
|
582f536d
yangbin
common:2022.1.28
|
34
35
36
37
38
39
40
|
func initProgressView() {
progressView.value = 0
progressView.label.text = LocString("同步")
progressView.label.textColor = UIColor.rgbColorFromHex(0x00993E)
progressView.layer.borderWidth = 1
progressView.layer.borderColor = UIColor.rgbColorFromHex(0x00993E).cgColor
}
|
75d24c15
yangbin
123
|
41
42
43
44
45
|
override func awakeFromNib() {
super.awakeFromNib()
|
582f536d
yangbin
common:2022.1.28
|
46
|
initProgressView()
|
75d24c15
yangbin
123
|
47
48
49
50
51
52
53
|
progressView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickHeaderView(_:))))
}
@objc private func clickHeaderView(_ gestureRecognizer: UITapGestureRecognizer) {
cellClickClosure?()
}
}
|