Adjusting selected account style

pull/2/head
Michael Scoff 7 years ago
parent c9ae0b7a98
commit 910683ae3f
  1. 2
      Trust/Accounts/ViewModels/AccountViewModel.swift
  2. 18
      Trust/Accounts/Views/AccountViewCell.swift
  3. 2
      Trust/Style/AppStyle.swift
  4. 8
      Trust/Tokens/Views/TokenViewCell.swift
  5. 2
      Trust/Transactions/Storage/Session.swift
  6. 8
      Trust/Transactions/Views/TransactionViewCell.swift

@ -19,7 +19,7 @@ struct AccountViewModel {
var image: UIImage? {
if isActive {
return R.image.accounts_active()
return UIImage.filled(with: Colors.lightBlack)
}
return nil
}

@ -9,23 +9,31 @@ class AccountViewCell: UITableViewCell {
let walletImageView = UIImageView()
let walletLabel = UILabel()
private struct Layout {
static let activeSize: CGFloat = 8
}
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
walletImageView.translatesAutoresizingMaskIntoConstraints = false
walletImageView.layer.cornerRadius = Layout.activeSize / 2
walletImageView.layer.masksToBounds = true
walletLabel.translatesAutoresizingMaskIntoConstraints = false
walletLabel.lineBreakMode = .byTruncatingMiddle
contentView.addSubview(walletImageView)
contentView.addSubview(walletLabel)
NSLayoutConstraint.activate([
walletImageView.widthAnchor.constraint(equalToConstant: 18),
walletImageView.heightAnchor.constraint(equalToConstant: 18),
walletImageView.widthAnchor.constraint(equalToConstant: Layout.activeSize),
walletImageView.heightAnchor.constraint(equalToConstant: Layout.activeSize),
walletImageView.centerYAnchor.constraint(equalTo: centerYAnchor),
walletImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Layout.sideMargin),
walletImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: StyleLayout.sideMargin),
walletLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Layout.sideMargin),
walletLabel.leadingAnchor.constraint(equalTo: walletImageView.trailingAnchor, constant: Layout.sideMargin),
walletLabel.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -StyleLayout.sideMargin),
walletLabel.leadingAnchor.constraint(equalTo: walletImageView.trailingAnchor, constant: StyleLayout.sideMargin),
walletLabel.topAnchor.constraint(equalTo: topAnchor),
walletLabel.bottomAnchor.constraint(equalTo: bottomAnchor),
])

@ -29,6 +29,6 @@ struct Colors {
static let lightBlack = UIColor(hex: "313849")
}
struct Layout {
struct StyleLayout {
static let sideMargin: CGFloat = 15
}

@ -51,10 +51,10 @@ class TokenViewCell: UITableViewCell {
NSLayoutConstraint.activate([
symbolImageView.widthAnchor.constraint(lessThanOrEqualToConstant: 40),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: Layout.sideMargin),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Layout.sideMargin),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -Layout.sideMargin),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Layout.sideMargin),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: StyleLayout.sideMargin),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -StyleLayout.sideMargin),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -StyleLayout.sideMargin),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: StyleLayout.sideMargin),
])
}

@ -30,7 +30,7 @@ class WalletSession {
}
func stop() {
balanceCoordinator.stop()
}
}

@ -51,10 +51,10 @@ class TransactionViewCell: UITableViewCell {
NSLayoutConstraint.activate([
statusImageView.widthAnchor.constraint(lessThanOrEqualToConstant: 44),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: Layout.sideMargin),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Layout.sideMargin),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -Layout.sideMargin),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Layout.sideMargin),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: StyleLayout.sideMargin),
stackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -StyleLayout.sideMargin),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -StyleLayout.sideMargin),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: StyleLayout.sideMargin),
])
}

Loading…
Cancel
Save