-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TransactionInfo module: apply new design for
status
item
- Loading branch information
Showing
7 changed files
with
147 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...et/UnstoppableWallet/Modules/TransactionInfo/Cells/TransactionInfoPendingStatusCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import UIKit | ||
import ThemeKit | ||
|
||
class TransactionInfoPendingStatusCell: BaseThemeCell { | ||
private let leftView = LeftCView() | ||
private let rightView = UIView() | ||
|
||
private let statusLabel = UILabel() | ||
private let barsProgressView = BarsProgressView(barWidth: 4, color: .themeGray50, inactiveColor: .themeSteel20) | ||
|
||
override init(style: CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
|
||
layout(leftView: leftView, leftInset: 0, rightView: rightView) | ||
|
||
rightView.addSubview(statusLabel) | ||
statusLabel.snp.makeConstraints { maker in | ||
maker.leading.equalToSuperview() | ||
maker.centerY.equalToSuperview() | ||
} | ||
|
||
statusLabel.font = .subhead1 | ||
statusLabel.textColor = .themeLeah | ||
|
||
rightView.addSubview(barsProgressView) | ||
barsProgressView.snp.makeConstraints { maker in | ||
maker.leading.equalTo(statusLabel.snp.trailing).offset(CGFloat.margin2x) | ||
maker.trailing.equalToSuperview() | ||
maker.centerY.equalToSuperview() | ||
maker.height.equalTo(18) | ||
} | ||
|
||
barsProgressView.set(barsCount: BarsProgressView.progressStepsCount) | ||
|
||
leftView.text = "status".localized | ||
leftView.image = UIImage(named: "Info Icon")?.tinted(with: .themeJacob) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
func bind(progress: Double, incoming: Bool, iconAction: (() -> ())?) { | ||
statusLabel.text = incoming ? "transactions.receiving".localized : "transactions.pending".localized | ||
leftView.imageAction = iconAction | ||
|
||
barsProgressView.set(filledColor: incoming ? .themeGreenD : .themeYellowD) | ||
barsProgressView.set(progress: progress) | ||
barsProgressView.startAnimating() | ||
} | ||
|
||
} |
Oops, something went wrong.