Skip to content

Commit

Permalink
- Change checkbox view
Browse files Browse the repository at this point in the history
- Update badges
- Change radiobutton images
- Change single input corner radius
  • Loading branch information
ant013 committed May 28, 2024
1 parent a31cc8e commit a7a4f36
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,8 @@
6BB14F6C2BF49E7100E879B2 /* WalletButtonHiddenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB14F6A2BF49E7100E879B2 /* WalletButtonHiddenManager.swift */; };
6BB14F722BFE550600E879B2 /* MarketEtfFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB14F712BFE550600E879B2 /* MarketEtfFetcher.swift */; };
6BB14F732BFE550600E879B2 /* MarketEtfFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB14F712BFE550600E879B2 /* MarketEtfFetcher.swift */; };
6BB14F752C01D04200E879B2 /* CheckBoxUiView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB14F742C01D04200E879B2 /* CheckBoxUiView.swift */; };
6BB14F762C01D04200E879B2 /* CheckBoxUiView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB14F742C01D04200E879B2 /* CheckBoxUiView.swift */; };
6BBCE4A32BDA419200ABBD55 /* Web3Wallet in Frameworks */ = {isa = PBXBuildFile; productRef = 6BBCE4A22BDA419200ABBD55 /* Web3Wallet */; };
6BBCE4A52BDA419B00ABBD55 /* Web3Wallet in Frameworks */ = {isa = PBXBuildFile; productRef = 6BBCE4A42BDA419B00ABBD55 /* Web3Wallet */; };
6BCD53002A161F4100993F20 /* BackupCloudModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BCD52F72A161F4100993F20 /* BackupCloudModule.swift */; };
Expand Down Expand Up @@ -4504,6 +4506,7 @@
6BAAF3462B9B245C00EFE5B2 /* SlideButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SlideButton.swift; sourceTree = "<group>"; };
6BB14F6A2BF49E7100E879B2 /* WalletButtonHiddenManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletButtonHiddenManager.swift; sourceTree = "<group>"; };
6BB14F712BFE550600E879B2 /* MarketEtfFetcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketEtfFetcher.swift; sourceTree = "<group>"; };
6BB14F742C01D04200E879B2 /* CheckBoxUiView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckBoxUiView.swift; sourceTree = "<group>"; };
6BCD52F72A161F4100993F20 /* BackupCloudModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupCloudModule.swift; sourceTree = "<group>"; };
6BCD52F92A161F4100993F20 /* ICloudBackupTermsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ICloudBackupTermsViewModel.swift; sourceTree = "<group>"; };
6BCD52FA2A161F4100993F20 /* ICloudBackupTermsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ICloudBackupTermsViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5718,6 +5721,7 @@
D3DB51AE2BD7AF860091BBDB /* DiffText.swift */,
D3B73E2F2BDFC5580067429D /* PriceRow.swift */,
D3833B042BF4AFB800ACECFB /* MarqueeView.swift */,
6BB14F742C01D04200E879B2 /* CheckBoxUiView.swift */,
);
path = SwiftUI;
sourceTree = "<group>";
Expand Down Expand Up @@ -10468,6 +10472,7 @@
11B3518BEA8865CADA5DA684 /* LaunchScreenManager.swift in Sources */,
D07157DC2A2DD968006F141F /* SendTronModule.swift in Sources */,
11B35A82532EC55909EFBAD8 /* LaunchScreen.swift in Sources */,
6BB14F762C01D04200E879B2 /* CheckBoxUiView.swift in Sources */,
11B35B925CE6EB25DF542611 /* CoinInvestorsService.swift in Sources */,
11B3545B8A5568792A4C43D8 /* CoinTreasuriesModule.swift in Sources */,
11B357ADA154348A3C1A987B /* CoinTreasuriesViewController.swift in Sources */,
Expand Down Expand Up @@ -12043,6 +12048,7 @@
11B3529CFD24A94DC35B476E /* CoinAnalyticsViewModel.swift in Sources */,
2FA5DE2F0DF6317DB807B7F3 /* TweetAttachmentView.swift in Sources */,
2FA5D6224C65D97B910F3A20 /* TweetPollView.swift in Sources */,
6BB14F752C01D04200E879B2 /* CheckBoxUiView.swift in Sources */,
2FA5D3C9CDBD7CF26508E1E9 /* ReferencedTweetView.swift in Sources */,
11B3551E5E9A6D167F7BA078 /* LaunchScreenManager.swift in Sources */,
11B35FA6F9EE876BD65E9AD6 /* LaunchScreen.swift in Sources */,
Expand Down Expand Up @@ -14055,7 +14061,7 @@
repositoryURL = "https://github.com/horizontalsystems/ComponentKit.Swift";
requirement = {
kind = exactVersion;
version = 2.0.12;
version = 2.0.13;
};
};
D3C187D3290FCF7D00FE1900 /* XCRemoteSwiftPackageReference "HUD" */ = {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ extension ManageAccountsViewController: SectionsDataSource {
CellBuilderNew.row(
rootElement: .hStack([
.image24 { component in
component.imageView.image = viewItem.selected ? UIImage(named: "circle_radioon_24")?.withTintColor(.themeJacob) : UIImage(named: "circle_radiooff_24")?.withTintColor(.themeGray)
component.imageView.image = viewItem.selected ? UIImage(named: "circle_radioon_24") : UIImage(named: "circle_radiooff_24")
},
.vStackCentered([
.text { component in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,7 @@ struct MultiSwapApproveView: View {

@ViewBuilder func row(text: String, selected: Bool) -> some View {
HStack(spacing: .margin16) {
Image("check_2_20")
.themeIcon(color: .themeJacob)
.opacity(selected ? 1 : 0)
.frame(width: .iconSize20, height: .iconSize20, alignment: .center)
.overlay(
RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous)
.stroke(Color.themeGray, lineWidth: .heightOneDp + .heightOnePixel)
)
CheckBoxUiView(checked: .init(get: { selected }, set: { _ in }))

Text(text).themeSubhead2(color: .themeLeah)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,7 @@ struct DuressModeSelectView: View {
Text(account.type.detailedDescription).themeSubhead2()
}

ZStack {
RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous)
.stroke(Color.themeGray, lineWidth: 1.5)
.frame(width: .margin24, height: .margin24)

if selectedAccountIds.contains(account.id) {
Image("check_2_20").themeIcon(color: .themeJacob)
}
}
CheckBoxUiView(checked: .init(get: { selectedAccountIds.contains(account.id) }, set: { _ in }))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,7 @@ struct OutputSelectorView: View {
viewModel.toggle(viewItem: viewItem)
}) {
HStack(spacing: .margin16) {
Image("check_2_20")
.themeIcon(color: .themeJacob)
.opacity(viewModel.selectedSet.contains(viewItem.id) ? 1 : 0)
.overlay(
RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous)
.stroke(Color.themeGray, lineWidth: .heightOneDp + .heightOnePixel)
)
CheckBoxUiView(checked: .init(get: { viewModel.selectedSet.contains(viewItem.id) }, set: { _ in }))

VStack(spacing: 1) {
Text(viewItem.date).themeBody()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ struct OutputSelectorView2: View {
viewModel.toggle(viewItem: viewItem)
}) {
HStack(spacing: .margin16) {
Image("check_2_20")
.themeIcon(color: .themeJacob)
.opacity(viewModel.selectedSet.contains(viewItem.id) ? 1 : 0)
.overlay(
RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous)
.stroke(Color.themeGray, lineWidth: .heightOneDp + .heightOnePixel)
)
CheckBoxUiView(checked: .init(get: { viewModel.selectedSet.contains(viewItem.id) }, set: { _ in }))

VStack(spacing: 1) {
Text(viewItem.date).themeBody()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SwapCoinCardCell: UITableViewCell {
maker.height.equalTo(formAmountInput.viewHeight)
}

amountInputWrapper.layer.cornerRadius = .cornerRadius8
amountInputWrapper.layer.cornerRadius = AmountInputCell.cornerRadius
amountInputWrapper.layer.cornerCurve = .continuous
amountInputWrapper.layer.borderWidth = .heightOnePixel
amountInputWrapper.layer.borderColor = UIColor.themeSteel20.cgColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extension SwitchAccountViewController: SectionsDataSource {
CellBuilderNew.row(
rootElement: .hStack([
.image24 { component in
component.imageView.image = viewItem.selected ? UIImage(named: "circle_radioon_24")?.withTintColor(.themeJacob) : UIImage(named: "circle_radiooff_24")?.withTintColor(.themeGray)
component.imageView.image = viewItem.selected ? UIImage(named: "circle_radioon_24") : UIImage(named: "circle_radiooff_24")
},
.vStackCentered([
.text { component in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import ThemeKit
import UIKit

class AmountInputCell: UITableViewCell {
static let cornerRadius: CGFloat = .cornerRadius8

private let formValidatedView: FormValidatedView
private let formAmountInputView: FormAmountInputView

init(viewModel: AmountInputViewModel) {
formAmountInputView = FormAmountInputView(viewModel: viewModel)
formValidatedView = FormValidatedView(contentView: formAmountInputView)
formValidatedView.set(cornerRadius: AmountInputCell.cornerRadius)

super.init(style: .default, reuseIdentifier: nil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ class CheckboxView: UIView {
maker.size.equalTo(CheckboxView.checkBoxSize)
}

checkBoxView.layer.cornerRadius = .cornerRadius4
checkBoxView.layer.cornerCurve = .continuous
checkBoxView.layer.borderColor = UIColor.themeGray.cgColor
checkBoxView.layer.borderWidth = .heightOneDp + .heightOnePixel
checkBoxView.layer.cornerRadius = .cornerRadius12
checkBoxView.layer.backgroundColor = UIColor.themeSteel20.cgColor

checkBoxView.addSubview(checkBoxImageView)
checkBoxImageView.snp.makeConstraints { maker in
maker.center.equalToSuperview()
}

checkBoxImageView.image = UIImage(named: "check_2_20")?.withRenderingMode(.alwaysTemplate)
checkBoxImageView.tintColor = .themeJacob
checkBoxImageView.image = UIImage(named: "check_2_24")?.withRenderingMode(.alwaysTemplate)
checkBoxImageView.isHidden = true
checkBoxImageView.tintColor = .themeDark

addSubview(descriptionLabel)
descriptionLabel.snp.makeConstraints { maker in
Expand Down Expand Up @@ -68,7 +67,10 @@ class CheckboxView: UIView {

var checked: Bool {
get { !checkBoxImageView.isHidden }
set { checkBoxImageView.isHidden = !newValue }
set {
checkBoxImageView.isHidden = !newValue
checkBoxView.layer.backgroundColor = newValue ? UIColor.themeYellowD.cgColor : UIColor.themeSteel20.cgColor
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FormValidatedView: UIView {
}

wrapperView.backgroundColor = .themeLawrence
wrapperView.layer.cornerRadius = .cornerRadius8
wrapperView.layer.cornerRadius = InputView.cornerRadius
wrapperView.layer.cornerCurve = .continuous
wrapperView.layer.borderWidth = CGFloat.heightOneDp
wrapperView.layer.borderColor = UIColor.themeSteel20.cgColor
Expand All @@ -37,6 +37,10 @@ class FormValidatedView: UIView {
}

extension FormValidatedView {
func set(cornerRadius: CGFloat) {
wrapperView.layer.cornerRadius = cornerRadius
}

func set(cautionType: CautionType?) {
let borderColor: UIColor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import ThemeKit
import UIKit

class InputView: UIView {
static let cornerRadius: CGFloat = .cornerRadius12

private let formValidatedView: FormValidatedView
private let inputStackView: InputStackView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct BadgeViewNew: View {
}
}
}
.padding(.horizontal, .margin4)
.padding(.horizontal, .margin6)
.padding(.vertical, .margin2)
.background(RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous).fill(Color.themeJeremy))
.clipShape(RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous))
.background(RoundedRectangle(cornerRadius: .cornerRadius8, style: .continuous).fill(Color.themeJeremy))
.clipShape(RoundedRectangle(cornerRadius: .cornerRadius8, style: .continuous))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import SwiftUI

struct CheckBoxUiView: View {
private let size: CGFloat = 24

@Binding var checked: Bool

var body: some View {
ZStack {
Circle()
.fill(checked ? Color.themeYellow : Color.themeSteel20)
.frame(width: size, height: size)

Image("check_2_24")
.themeIcon(color: .themeDark)
.opacity(checked ? 1 : 0)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ import SwiftUI
import ThemeKit

struct CheckboxStyle: ToggleStyle {
private let size: CGFloat = .margin24 - .heightOneDp

func makeBody(configuration: Configuration) -> some View {
Button(action: {
configuration.isOn.toggle()
}, label: {
Image("check_2_20")
.themeIcon(color: .themeJacob)
.opacity(configuration.isOn ? 1 : 0)
.frame(width: size, height: size, alignment: .center)
CheckBoxUiView(checked: configuration.$isOn)
})
.overlay(
RoundedRectangle(cornerRadius: .cornerRadius4, style: .continuous)
.stroke(Color.themeGray, lineWidth: .heightOneDp + .heightOnePixel)
)

configuration.label
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct CautionBorder: ViewModifier {
let cornerRadius: CGFloat
@Binding var cautionState: CautionState

init(cornerRadius: CGFloat = .cornerRadius8, cautionState: Binding<CautionState>) {
init(cornerRadius: CGFloat = InputView.cornerRadius, cautionState: Binding<CautionState>) {
self.cornerRadius = cornerRadius
_cautionState = cautionState
}
Expand All @@ -100,7 +100,7 @@ struct FieldCautionBorder: ViewModifier {
let cornerRadius: CGFloat
@Binding var cautionState: FieldCautionState

init(cornerRadius: CGFloat = .cornerRadius8, cautionState: Binding<FieldCautionState>) {
init(cornerRadius: CGFloat = InputView.cornerRadius, cautionState: Binding<FieldCautionState>) {
self.cornerRadius = cornerRadius
_cautionState = cautionState
}
Expand Down

0 comments on commit a7a4f36

Please sign in to comment.